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

Failed to require/import @status-im/js in Node.js #390

Open
yqrashawn opened this issue May 5, 2023 · 2 comments
Open

Failed to require/import @status-im/js in Node.js #390

yqrashawn opened this issue May 5, 2023 · 2 comments

Comments

@yqrashawn
Copy link

Got Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/yqrashawn/Downloads/test/node_modules/js-waku/package.json error
CleanShot 2023-05-05 at 15 47 11

@yqrashawn
Copy link
Author

When require("@status-im/js")

Node.js complains about js-waku/package.json, because there are only types and import, no require

    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js"
    },

When import statusjs from "@status-im/js"

Node.js import the @status-im/js/dist/index.cjs not @status-im/js/dist/index.js

When import statusjs from "@status-im/js/dist/index.js"; instead of cjs

Node.js complains about can't find ethereum-cryptography/utils because it's not ethereum-cryptography/utils.js and there's no exports in node_modules/ethereum-cryptography/package.json

@yqrashawn
Copy link
Author

A bit background

I'm currently working on ISSUE3 in this issue status-im/status-mobile#15500 (comment)
which requires updating https://github.com/status-im/universal-links-handler to fetch user display name from waku

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