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]: esm default import with shared does not properly access the default function #8043

Open
jmvtrinidad opened this issue Oct 2, 2024 · 2 comments
Assignees
Labels
A-module-federation Area:module federation bug Something isn't working

Comments

@jmvtrinidad
Copy link

jmvtrinidad commented Oct 2, 2024

System Info

System:
OS: macOS 15.0
CPU: (12) arm64 Apple M2 Pro
Memory: 74.30 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.4.0 - ~/.nvm/versions/node/v22.4.0/bin/node
npm: 10.8.1 - ~/.nvm/versions/node/v22.4.0/bin/npm
pnpm: 9.11.0 - ~/.nvm/versions/node/v22.4.0/bin/pnpm
bun: 1.1.4 - ~/.bun/bin/bun
Browsers:
Chrome: 129.0.6668.90
Edge: 129.0.2792.65
Safari: 18.0
npmPackages:
@rspack/cli: ^1.0.2 => 1.0.5
@rspack/core: ^1.0.2 => 1.0.5
@rspack/dev-server: ^1.0.2 => 1.0.5
@rspack/plugin-minify: ^0.7.5 => 0.7.5
@rspack/plugin-react-refresh: ^1.0.0 => 1.0.0

Details

orginal code from react calendar
Image
generated code from rspack
Image

Reproduce link

  1. Clone the repository: git clone [email protected]:jmvtrinidad/issues.git
  2. Checkout the branch: git checkout rspackDefaultExportIssue
  3. Serve the app: nx serve host
  4. Build the app with react calendar - it still works.
  5. Install clsx - the issue appears, failing to infer the correct module.

Reproduce Steps

Works without clsx in package.json:

  • Image
  • Image

Fails with clsx installed in package json and being shared by rspack:

  • Image
  • Image

Additional Context

Prior to switching to rspack, webpack produced the following outputs which is working:

  • Image
  • Image
@jmvtrinidad jmvtrinidad added bug Something isn't working pending triage The issue/PR is currently untouched. labels Oct 2, 2024
@jmvtrinidad jmvtrinidad changed the title [Bug]: default export does not properly being access on react-calendar [Bug]: esm default import with shared does not properly access the default import Oct 3, 2024
@jmvtrinidad jmvtrinidad changed the title [Bug]: esm default import with shared does not properly access the default import [Bug]: esm default import with shared does not properly access the default function Oct 3, 2024
@SoonIter SoonIter added A-module-federation Area:module federation and removed pending triage The issue/PR is currently untouched. labels Oct 8, 2024
@loveholly
Copy link

Seems like we got something similar to this issue: module-federation/core#2995

@jmvtrinidad
Copy link
Author

@loveholly I tried the same on the webpack but it was working fine as Added on the original description in Additional Context section.

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

No branches or pull requests

4 participants