SSR bundle fails to load with rspack 2.3.2
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- build-system, testing
Research direction
Start with the SSR configuration in rspack.config.js and reproduce the failure with npm ci, npm run build, then node build/ssr.js on the Dependabot branch. Compare the minified bundle with the lit-html source and review the linked upstream issue and PR. Done when the SSR bundle loads with @rspack/core 2.3.2 or later and the test checks pass without disabling module concatenation or minimization.
Written by the indexing model from the issue text.
Description
What information was incorrect, unhelpful, or incomplete?
The SSR bundle fails to load with @rspack/core 2.3.2 and 2.3.3 (2.3.1 works). @rspack/cli is not affected: main currently pairs @rspack/cli 2.3.2 with @rspack/core 2.3.1:
ReferenceError: Cannot access 'L' before initialization
at lit-html/node/lit-html.js
at lit-html/node/directives/unsafe-html.js
at insane/toMap.js
This breaks npm run preview and npx @mdn/fred ssr, so the test checks fail on the Dependabot bump.
What did you expect to see?
The SSR bundle loads with @rspack/core 2.3.2 and later, so the bump can be merged.
Do you have any supporting links, references, or citations?
Related to https://github.com/mdn/fred/pull/2091
Related upstream issue: https://github.com/web-infra-dev/rspack/issues/16586
Do you have anything more you want to share?
Steps to reproduce: check out the PR branch, run npm ci, npm run build, then node build/ssr.js.
Setting optimization.concatenateModules: false (or minimize: false) on ssrConfig in rspack.config.js avoids the error with 2.3.2.
The minified SSR bundle contains let M=class I extends I{...} where the source is class I extends H in lit-html. The minifier renames H to I, which clashes with the class's own kept name (mangle: { keep_classnames: true }), so extends I refers to the class itself. This is the same bug family as the upstream issue above, whose fix (rspack 2.3.3) does not cover the extends clause. A new upstream issue is still needed.
- Dominant language
- JavaScript
- Stars
- 242
- Forks
- 66
- Avg merge
- 1d 2m
- Merged PRs (30d)
- 49
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mdn/fred
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Overlapping icons on Github menu linkPossibly taken @danielhjacobs claimed this 71 days ago. Openp1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Skip Link: Pressing "Tab" after activating "Skip to main content" returns focus to the top of the page in FirefoxPossibly taken @caugner claimed this 51 days ago. Openp1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mdn/fred#1726 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
p1
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
wso2/api-platform#4369 ·
Maintainers usually reply within 1 day
-
Own-agent checks: reject the Actions bot id in admit.mjs and test the source label in pr-verifyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melodic-software/claude-code-plugins#17374 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
keyxmakerx/Chronicle#2284 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
soroswap/token-list#125 ·
Maintainers usually reply within 1 day