Skip to content
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

[Bug]: Multiple entry files packaged esm file import error undefind #316

Open
tym3515 opened this issue Oct 22, 2024 · 2 comments
Open

[Bug]: Multiple entry files packaged esm file import error undefind #316

tym3515 opened this issue Oct 22, 2024 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@tym3515
Copy link

tym3515 commented Oct 22, 2024

Version

"@rslib/core": "^0.0.12",

{
format: 'esm',
output: {
injectStyles: true,
asyncChunks:false,
distPath: {
root: './dist/esm',
css: '.',
cssAsync: '.',
},
},

Details

entry: {
install: './src/install.js',
Active: './src/lib/Active.js',
}

Reproduce link

aAAA

Reproduce Steps

"devDependencies": {
"@eslint/js": "^9.12.0",
"@rsbuild/core": "^1.0.13",
"@rsbuild/plugin-basic-ssl": "^1.1.1",
"@rsbuild/plugin-sass": "^1.0.3",
"@rsbuild/plugin-vue2": "^1.0.1",
"@rslib/core": "^0.0.12",
"eslint": "^9.12.0",
"globals": "^15.11.0",
"prettier": "^3.3.3"
}

@tym3515 tym3515 added the 🐞 bug Something isn't working label Oct 22, 2024
@Timeless0911
Copy link
Collaborator

Can you describe clearly and provide a reproduce demo?

@fi3ework
Copy link
Member

A minimal reproduction with webpack. https://stackblitz.com/edit/node-oapeg8?file=webpack.config.js,package.json,bar.js,dist-single-entry%2Fmain.mjs,README.md

Currently, the main issue is that when there are multiple entries, the bailout reasons between different entries are not isolated. This affects the concatenation results of each entry.

With multiple entries, the ./bar.js bails out from main concatenation module. There is no problem when only a main entry.

asset main.mjs 2.98 KiB [emitted] [javascript module] (name: main)
asset bar.mjs 1.65 KiB [compared for emit] [javascript module] (name: bar)
Entrypoint main 2.98 KiB = main.mjs
Entrypoint bar 1.65 KiB = bar.mjs
runtime modules 1.31 KiB 6 modules
orphan modules 61 bytes [orphan] 1 module
cacheable modules 209 bytes
  ./main.js + 1 modules 183 bytes [built] [code generated]
+    ModuleConcatenation bailout: Cannot concat with ./bar.js: Module is an entry point
  ./bar.js 26 bytes [built] [code generated]
webpack 5.95.0 compiled successfully in 124 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants