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]: DLL Reference plugin results in ESModulesLinkingWarning for CJS files #9016

Closed
robrichard opened this issue Jan 15, 2025 · 0 comments · Fixed by #9050 or #9091
Closed

[Bug]: DLL Reference plugin results in ESModulesLinkingWarning for CJS files #9016

robrichard opened this issue Jan 15, 2025 · 0 comments · Fixed by #9050 or #9091
Assignees
Labels
bug Something isn't working

Comments

@robrichard
Copy link

System Info

  System:
    OS: macOS 15.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 100.17 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /usr/local/bin/node
    Yarn: 3.3.0 - ~/.npm-global/bin/yarn
    npm: 10.2.4 - /usr/local/bin/npm
    Watchman: 2023.09.04.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 131.0.6778.265
    Firefox: 133.0.3
    Safari: 18.1

Details

Rspack warns (or errors with strictExportPresence: true) when referencing a cjs module from a DLL manifest.

Reproduce link

https://github.com/robrichard/rspack-dll-test

Reproduce Steps

  1. Create a DLL manifest containing cjs modules, example relay-runtime
  2. Create a bundle using strictExportPresence: true and DLLReferencePlugin using the manifest created in step 1
  3. Build fails with the below error
$ npm run build                                                      

> [email protected] build
> rspack build -c ./config/rspack.dll.config.js && rspack build -c ./config/rspack.dllRef.config.js

Rspack compiled successfully in 141 ms
ERROR in ./src/entry.js
  × ESModulesLinkingError: export 'readInlineData' (imported as 'readInlineData') was not found in 'relay-runtime' (module has no exports)
   ╭─[3:12]
 1 │ import { readInlineData } from 'relay-runtime';
 2 │ 
 3 │ console.log(readInlineData)
   ·             ──────────────
   ╰────


Rspack compiled with 1 error in 13 ms
@robrichard robrichard added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jan 15, 2025
@stormslowly stormslowly self-assigned this Jan 16, 2025
@stormslowly stormslowly removed the pending triage The issue/PR is currently untouched. label Jan 16, 2025
@ahabhgk ahabhgk reopened this Jan 22, 2025
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
3 participants