Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in... error

See original GitHub issue

Getting an error when I try to use estree-walker with esbuild:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/sam/Nine/components/node_modules/estree-walker/package.json
    at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:479:7)
    at resolveExports (internal/modules/cjs/loader.js:432:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/sam/Nine/components/dist/src/main.js:43:39)
    at Module._compile (internal/modules/cjs/loader.js:1063:30) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node Version: v14.15.4

tsconfig.json:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "allowJs": true,
    "importHelpers": true,
    "alwaysStrict": true,
    "sourceMap": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitAny": false,
    "noImplicitThis": false,
    "strictNullChecks": false
  },
  "include": ["src/**/*", "__tests__/**/*"]
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:22
  • Comments:10

github_iconTop GitHub Comments

4reactions
Timmmmcommented, Mar 1, 2021

Downgrading to 2.0.2 fixes it, and there don’t appear to have been any code changes between 2.0.2 and 3.0.0 - just packaging changes so I guess those broke it somehow.

3reactions
flipkickmediacommented, Jul 8, 2022

v3.0.1 - same problem. Can we get an es and cjs build plz?

This has been going on since 21st Feb 2021. Ill fork the repo and fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No "exports" main resolved in /app/node_modules/@babel ...
With node 12.20.0, node 14.17.4, the error is not thrown. The issue is that a new system for exports has been created, as...
Read more >
Error [ERR_PACKAGE_PATH_NOT_EXPORTED] #142 - GitHub
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../node_modules/jose/package.json means you're doing require/import of just ...
Read more >
No "exports" main defined - Laracasts
Hello , After cloning my project I got the error bellow when I npm run watch (I deleted ... Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports"...
Read more >
No "exports" main resolved in@babel/helper-compilation ...
Coding example for the question Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in@babel/helper-compilation-targets/package.json-babel.js.
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
If both "exports" and "main" are defined, the "exports" field takes precedence ... require('pkg/subpath.js') throws an ERR_PACKAGE_PATH_NOT_EXPORTED error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found