首页 > 解决方案 > Svelte: Uncaught ReferenceError: exports is not defined

问题描述

Background

I am trying to use dgraph-js-http in a Svelte application.

Error

The initial error I was facing was:

Uncaught ReferenceError: buffer is not defined
    <anonymous> http://localhost:5000/build/bundle.js:6947

I'm including this as maybe my solution to this was not the best, and that hopefully there is a way to solve both this issue, and the current blocker issue.

However, after a trial-and-error approach (see below for the various things I've tried) I'm now stuck.

Current error

After solving the above error, I am now blocked on this error:

Uncaught ReferenceError: define is not defined

Attempts to resolve

None of the following have worked.

Uncaught ReferenceError: exports is not defined

标签: javascriptnode.jssvelte

解决方案


推荐阅读