-
Notifications
You must be signed in to change notification settings - Fork 38
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
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in... error #26
Comments
I get the exact same issue, seems like it is nothing to do with esbuild:
|
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. |
Same error in my environment! |
Same here. |
I guess this package is not planned to be used in a CommonJS module anymore. It's written as a ES Module and published directly from the src, so it's necessary to use "type": "module" in package.json and convert your package to esm or use a custom resolver. To test it in the cli:
The only thing I found weird is that there's still a "package.json" file under the "src" folder published. You'll only see this by installing the package and inspecting the node_modules since it's not in the repo and is not generated by the build process. I guess it was a left over in the pc of the person who published the last version, since there's no cleaning script pre-publish. This broke my ESLint module resolution for the import/export plugin and removing that file solved it. |
same here, any progress? version@2.0.2 is fine,thank you |
Same issue using TSX and MDX. |
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. |
This is an ESM only package now. But it's still possible to use it from CJS: You will have to use dynamic imports like this: const { walk } = await import("estree-walker");
walk(...); |
The usage example on README.md doesn't work at all. At least update the readme if you are dropping cjs support. |
The error ERR_PACKAGE_PATH_NOT_EXPORTED occurs because the estree-walker package does not have an appropriate export defined for CommonJS modules in its package.json file. By adding ".": {
"types": "./types/index.d.ts",
"import": "./src/index.js",
"require": "./src/index.js"
} |
Getting an error when I try to use estree-walker with esbuild:
Node Version: v14.15.4
tsconfig.json:
The text was updated successfully, but these errors were encountered: