ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

No "exports" main defined while using Babelrc for Node js 16 #4313

Closed HariApplogiq closed 1 year ago

HariApplogiq commented 1 year ago

Severity:

Critical

Description:

No "exports" main defined in while running with babelrc

Steps to reproduce the error:

Install Npm i ipfs-core ; Then try import as Mentioned in npm docs import * as IPFS from "ipfs-core";

async function loadIpfs(file) { // const { create } = await import("ipfs"); const ipfs = await IPFS.create().catch((e) => { throw new ApiError(400, e); }); const { cid } = await ipfs.add(file); const data = { cid, ipfs, };

return data; }

Error:

node:internal/modules/cjs/loader:499 throw e; ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/hariganesh/Desktop/Hariganesh/HariBackup/Projects/Crypto-pets/Source/crypto-pets-admin-api/node_modules/ipfs-core/package.json

welcome[bot] commented 1 year ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

rolandsaven commented 1 year ago

@HariApplogiq does this help? https://github.com/ipfs/js-ipfs/issues/4256

SgtPooki commented 1 year ago

Hello @HariApplogiq,

js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and the corresponding migration guide here.

This current bug or feature request will not be addressed in js-ipfs due to its deprecation. Unfortunately we don’t expect to support it in Helia either.

As a result, we are going to close this issue. If you think we have done this in error, please feel to reopen with any comments in the next week as we will circle back on the reopened issues.

We hope you will consider Helia for your IPFS in JS needs. We look forward to engaging with you more there.

Thanks, @ipfs/helia-dev