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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: @babel/parser: __esModule property is not defined in lib/index.js since version 7.22.11 #15934
Comments
Hey @tkallage! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
I'm incredibly confused by how this could have happened |
@nicolo-ribaudo #15038 I guess it is. |
As a quick fix, we could just concatenate |
I found a workaround and will open a PR later. :) |
Thanks for the fast fix! |
馃捇
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
working in 7.22.10:
npm i @babel/parser@7.22.10 local-pkg@0.4.3
run in
node
REPL:Result:
[Function: parse]
not working in 7.22.11:
npm i @babel/parser@7.22.11 local-pkg@0.4.3
run in
node
REPL:Result:
undefined
And
Result:
[Function: parse]
Configuration file name
No response
Configuration
No response
Current and expected behavior
unplugin-vue-components uses
importModule()
from the package local-pkg to import @babel/parser.It recognizes the property __esModule to import the default export of @babel/parser.
With @babel/parser 7.22.10 this works fine, but since 7.22.11 the esModule-marker is missing in the resulting lib/index.js file, resulting in the imported object
{ default: { parser(), ... } }
instead of{ parser(), ... }
.Environment
System:
OS: Windows 10 10.0.22621
Binaries:
Node: 18.12.0 - C:\Program Files\nodejs\node.EXE
npm: 9.8.1 - <project_path>\node_modules.bin\npm.CMD
pnpm: 8.5.0 - C:\Program Files\nodejs\pnpm.CMD
npmPackages:
@babel/parser: ^7.22.11 => 7.22.11
@babel/runtime: ^7.22.11 => 7.22.11
eslint: ^8.48.0 => 8.48.0
Possible solution
Add
at the top of the resulting file
/lib/index.js
in @babel/parserAdditional context
The text was updated successfully, but these errors were encountered: