storacha / w3name

IPNS client and service for generating, updating, and tracking immutable names with signed updates
Other
45 stars 12 forks source link

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in (...)/package.json #72

Closed kasperpawlowski closed 2 years ago

kasperpawlowski commented 2 years ago

Hey,

After recent update of web3.storage package to 4.4.0, my script that uses Name stopped working. I tried installing a new w3name package with no success. The error I see, both using the new package and web3.storage with proxy (as per commit) is:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in (...)/node_modules/w3name/package.json
    at new NodeError (node:internal/errors:372:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:472:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:693:7)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/kasper/euler/w3name-test/w3name-MRE/index.js:1:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

At first, I thought it's my JS environment issue, as I have a Common JS TypeScript project. However, I transformed it to ES and I'd still see the same thing. Then I tried to use the package in a fresh node.js repo as you can see here. When trying to import the package, I get the same error message.

kasperpawlowski commented 2 years ago

works with v1.0.6. can be closed