Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in node_modules/ipfs/package.json #4256

Closed
achingbrain opened this issue Nov 22, 2022 · 1 comment
Assignees

Comments

@achingbrain
Copy link
Member

achingbrain commented Nov 22, 2022

js-ipfs@0.63 made the jump to become ESM-only. If you are seeing the error message above, it's because you are trying to load ESM code using require from a CJS environment.

Instead you need to either convert your code to ESM and use import, or use the dynamic import function if you cannot convert to ESM.

Please see the upgrade guide for more information.

Note if you are authoring TypeScript and using import you also need to ensure that your tsc settings result in ESM and not CJS.

Please see the TypeScript section of the upgrade guide for more information.

@achingbrain achingbrain pinned this issue Nov 22, 2022
@ipfs ipfs locked as resolved and limited conversation to collaborators Nov 22, 2022
@ipfs ipfs deleted a comment from welcome bot Nov 22, 2022
@whizzzkid whizzzkid assigned achingbrain and unassigned whizzzkid May 23, 2023
@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see #4336).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants