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

@libp2p/identify import { CodeError, ERR_NOT_FOUND } from '@libp2p/interface/errors'; #2245

Closed
benzmuircroft opened this issue Nov 19, 2023 · 5 comments
Labels
need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization

Comments

@benzmuircroft
Copy link

(node:1678537) UnhandledPromiseRejectionWarning: file:///home/benz/Desktop/vite/app/node_modules/@libp2p/identify/dist/src/identify.js:2
import { CodeError, ERR_NOT_FOUND } from '@libp2p/interface/errors';
                    ^^^^^^^^^^^^^
SyntaxError: The requested module '@libp2p/interface/errors' does not provide an export named 'ERR_NOT_FOUND'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:1678537) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
  • Version:
    latest

  • Platform:
    Linux benz-iMac 5.15.0-88-generic 98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

  • Subsystem:
    libp2p

Severity:

boom

Description:

Steps to reproduce the error:

const { identify } = await import('@libp2p/identify')

@benzmuircroft benzmuircroft added the need/triage Needs initial labeling and prioritization label Nov 19, 2023
@maschad
Copy link
Member

maschad commented Nov 20, 2023

Will be solved by #2240

@christroutner
Copy link

christroutner commented Dec 3, 2023

I am also on a Ubuntu Linux system. I'm running node v18 and I'm using the latest version of libp2p: v1.0.6. I'm still seeing this error when I try to run my app:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './identify' is not defined by "exports" in /home/trout/work/psf/code/ipfs-service-provider/node_modules/libp2p/package.json imported from /home/trout/work/psf/code/ipfs-service-provider/src/adapters/ipfs/ipfs.js
    at new NodeError (node:internal/errors:393:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:358:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:668:3)
    at packageResolve (node:internal/modules/esm/resolve:843:14)
    at moduleResolve (node:internal/modules/esm/resolve:909:20)
    at defaultResolve (node:internal/modules/esm/resolve:1124:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

I was previously running version 0.46.16. It runs fine, but it's having issues with webRTC Circuit Relay connections, so I was hoping to fix it by upgrading.

@christroutner
Copy link

I was able to successfully run v0.46.21. But v1.0.0 exhibits this issue.

@achingbrain
Copy link
Member

Package subpath './identify' is not defined by "exports" in /path/to/node_modules/libp2p/package.json

Please see the upgrade guide, in particular the section about identify.

@achingbrain achingbrain added need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization and removed need/triage Needs initial labeling and prioritization labels Dec 5, 2023
@achingbrain
Copy link
Member

Closing as a duplicate of #2244 - the error message is slightly different but the underlying cause and the fix is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

4 participants