Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: require is not defined #469

Open
pmannle opened this issue Dec 6, 2021 · 1 comment
Open

ReferenceError: require is not defined #469

pmannle opened this issue Dec 6, 2021 · 1 comment

Comments

@pmannle
Copy link

pmannle commented Dec 6, 2021

Working on a Rari dashboard, but can't get SDK to load.

I've set node and npm as required:
node: v14.17.0
npm: v7.21.0

Script is simply:
const Fuse = require("@Rari-Capital/fuse-sdk");

And getting:

ReferenceError: require is not defined
    at file:///Users/phil_mannle/Solidity/fuse-sdk/index.js:1:14
    at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
    at async Loader.import (internal/modules/esm/loader.js:177:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)

Can anyone advise?

@pmannle
Copy link
Author

pmannle commented Dec 6, 2021

Here is my package.json:

{
  "name": "fuse-sdk",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "type": "module",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@rari-capital/fuse-sdk": "^1.1.0"
  }
}

I've also tried "type":"commonjs"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant