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

Error while importing the package #434

Closed
l3lackcurtains opened this issue Jun 30, 2024 · 1 comment
Closed

Error while importing the package #434

l3lackcurtains opened this issue Jun 30, 2024 · 1 comment

Comments

@l3lackcurtains
Copy link

When importing noise from the package

const { noise } = require("@chainsafe/libp2p-noise");

It says

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined
@achingbrain
Copy link
Collaborator

This is a ESM only package, that means you need to use import and not require.

Further reading: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

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

2 participants