missing extension in import paths in @babel/runtime/helpers/esm #12158
Labels
i: bug
i: needs triage
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Bug Report
File extensions are required in import statements in ES Modules.
But files within
@babel/runtime/helpers/esm
(which are treated as ES Modules because@babel/runtime/helpers/esm/package.json
containstype: "module"
) don't use extensions in their import statements.Current behavior
I'm getting this correct error with Webpack 5:
This is because the first line of
@babel/runtime/helpers/esm/get.js
is an import without an extension:Input Code
Expected behavior
No problems using
@babel/plugin-transform-runtime
withuseESModules: true
Babel Configuration
Environment
@babel/runtime
: 7.11.2@babel/plugin-transform-runtime
: 7.11.5webpack
: 5.0.0-rc.4babel-loader
: 8.1.0Possible Solution
Use full extensions in imports inside
@babel/runtime/helpers/esm
, so I don't get these errors, for example:The text was updated successfully, but these errors were encountered: