You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log((0, foo.foo)());
^
TypeError: (0 , foo.foo) is not a function
at /root/dist/index.js:22:25
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
The text was updated successfully, but these errors were encountered:
Do you expect foo is shared between dist/foo.js and dist/index.js?
Sharing modules could break ESM and it's a known issue. We might support non-sharing mode (like turn off https://esbuild.github.io/api/#splitting in esbuild) in short time to make sure the output is correct at least.
Version
System: OS: macOS 14.6.1 CPU: (12) arm64 Apple M2 Max Memory: 14.12 GB / 96.00 GB Shell: 3.7.1 - /opt/homebrew/bin/fish Browsers: Chrome: 130.0.6723.117 Safari: 17.6 npmPackages: @rslib/core: ^0.0.18 => 0.0.18
Details
I'm building an library using Rslib with multiple entries:
And
index
is usingfoo
as dependencies:But this results in get an empty module
./src/foo.ts
indist/index.js
:which would cause error at runtime.
Reproduce link
https://github.com/colinaaa-reproductions/rslib-repro-multi-entries
Reproduce Steps
pnpm install
pnpm build
node dist/index.js
An error occurs:
The text was updated successfully, but these errors were encountered: