-
Notifications
You must be signed in to change notification settings - Fork 583
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
Webpack 5 warning "Should not import named export from default-exporting module" #1504
Comments
The bundling is successful, and bundled file runs without any errors: $ node dist/main.js
{
...
} |
Multiple packages have fixed it by using default import for package.json, for example: |
Refs: webpack/webpack#9246 |
Verified that the warning is no longer emitted with package.json{
"dependencies": {
"@aws-sdk/client-dynamodb": "1.0.0-gamma.9"
},
"devDependencies": {
"webpack": "5.0.0-beta.29",
"webpack-cli": "4.0.0-beta.8"
}
} index.jsconst { DynamoDB } = require("@aws-sdk/client-dynamodb");
(async () => {
const client = new DynamoDB({});
console.log(await client.listTables({ Limit: 1 }));
})(); $ ./node_modules/.bin/webpack --entry index.js --target=node
✅ Compilation Results
🌏 Version: 5.0.0-beta.29
⚒️ Built: Wed Sep 16 2020 07:26:48 GMT-0700 (Pacific Daylight Time)
⏱ Compile Time: 9362ms
📂 Output Directory: /Users/trivikr/workspace/webpack-5-demo/dist
#️⃣ Hash: bfaa9b843a55b481a5c3
┌────────────┬──────────────────────────────────────────────────────────────────────────────────────────────┐
│ Entrypoint │ Bundle │
├────────────┼──────────────────────────────────────────────────────────────────────────────────────────────┤
│ main │ Bundle Name │ main.js │
│ │ Compared For Emit │ false │
│ │ Bundle size │ 275.50 kb │
│ │ │
│ │ Modules: │
│ │ ./index.js [size: 169 bytes] │
│ │ ./node_modules/@aws-sdk/client-dynamodb/dist/es/index.js + 158 modules [size: 1000992 bytes] │
│ │ ./node_modules/@aws-sdk/client-dynamodb/dist/es/package.json [size: 2517 bytes] │
│ │ ./node_modules/uuid/index.js [size: 120 bytes] │
│ │ ./node_modules/uuid/lib/bytesToUuid.js [size: 775 bytes] │
│ │ ./node_modules/uuid/lib/rng.js [size: 246 bytes] │
│ │ ./node_modules/uuid/v1.js [size: 3331 bytes] │
│ │ ./node_modules/uuid/v4.js [size: 680 bytes] │
│ │ external "buffer" [size: 42 bytes] │
│ │ external "child_process" [size: 42 bytes] │
│ │ external "crypto" [size: 42 bytes] │
│ │ external "fs" [size: 42 bytes] │
│ │ external "http" [size: 42 bytes] │
│ │ external "http2" [size: 42 bytes] │
│ │ external "https" [size: 42 bytes] │
│ │ external "os" [size: 42 bytes] │
│ │ external "path" [size: 42 bytes] │
│ │ external "process" [size: 42 bytes] │
│ │ external "stream" [size: 42 bytes] │
│ │ external "url" [size: 42 bytes] │
│ │ webpack/runtime/compat get default export [size: 263 bytes] │
│ │ webpack/runtime/define property getters [size: 308 bytes] │
│ │ webpack/runtime/hasOwnProperty shorthand [size: 86 bytes] │
│ │ webpack/runtime/make namespace object [size: 274 bytes] │
└────────────┴──────────────────────────────────────────────────────────────────────────────────────────────┘
[webpack-cli] configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/ |
For future reference, verified that Rollup$ ./node_modules/.bin/rollup --version
rollup v2.27.0
$ ./node_modules/.bin/rollup index.js --file dist/bundle.js
index.js → dist/bundle.js...
created dist/bundle.js in 41ms esbuild$ ./node_modules/.bin/esbuild --version
0.7.1
$ ./node_modules/.bin/esbuild --bundle index.js --platform=node --outdir=dist |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Is your feature request related to a problem? Please describe.
When v3 is bundled using webpack@beta, the following warnings are shown:
Quick test for bundling:
package.json
index.js
Describe the solution you'd like
Webpack 5 is expected to released on 2020-10-10 as discussed in webpack/webpack#11406
Warning shouldn't be emitted when using AWS JS SDK v3
Describe alternatives you've considered
Ignoring the warning, as the application gets bundled and bundle file can be run without errors.
The text was updated successfully, but these errors were encountered: