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
This issue was found, analyzed, and filed by a Claude Code agent (Claude Opus 4.6) on behalf of GitHub user @robcmills. Rob reviewed the analysis and condoned opening this issue. Totally understand if you'd prefer not to accept issues from agents, but this is a real bug that affected our project and we wanted to report it upstream. Happy to answer questions or provide more context.
Environment
cypress-rspack-dev-server: 1.1.1
cypress: 15.13.0
@rspack/core: 1.7.7
@rspack/dev-server: 1.2.1
Mode: interactive/open (cypress open --component)
Bug Description
When running component tests in interactive (open) mode, two 404 errors appear in the browser console on every spec run:
GET http://localhost:8080/__cypress/iframes/undefined 404 (Not Found)
GET http://localhost:8080/__cypress/src/spec-0.js 404 (Not Found)
Tests still pass — the errors are non-blocking — but they produce noisy console output and could mask real issues.
Root Cause: contenthash filename mismatch after PR #41
PR #41 changed the output filename in makeDefaultRspackConfig.js (line 31) from [name].js to [name].[contenthash].js to fix a chunk-loading conflict. However, loader.js (line 28) still hardcodes the URL without the content hash:
But the actual compiled file is something like spec-0.abc123def.js (with the content hash). So the relativeUrl 404s because no file exists at spec-0.js.
This doesn't break test execution because Cypress loads specs through the shouldLoad() + dynamic import() mechanism in the loader, not through the relativeUrl fetch. But Cypress's runner does attempt to fetch relativeUrl (likely for sourcemap resolution), producing the 404.
Suggested fix
Either:
Update loader.js to not hardcode .js and instead derive the actual hashed filename from the compilation output
Or remove [contenthash] from the filename template and find an alternative fix for the original chunk conflict that PR fix: avoid filename conflict #41 addressed
Secondary issue: iframes/undefined race condition
The /__cypress/iframes/undefined 404 appears to be a timing issue where Cypress constructs the iframe URL before spec.absolute is populated. This may be related to the dev-server:compile:success event being emitted (in CypressCTRspackPlugin.js:104) before the spec list is fully synchronized via dev-server:specs:changed. This only occurs in interactive mode — in headless/run mode, justInTimeCompile changes the timing so specs are pre-compiled before the runner loads them.
Reproduction
Configure cypress-rspack-dev-server with any React project using rspack
Run cypress open --component
Click any spec to run it
Open browser DevTools console — observe the two 404 errors
The errors do not appear when running headless (cypress run --component).
Disclosure
This issue was found, analyzed, and filed by a Claude Code agent (Claude Opus 4.6) on behalf of GitHub user @robcmills. Rob reviewed the analysis and condoned opening this issue. Totally understand if you'd prefer not to accept issues from agents, but this is a real bug that affected our project and we wanted to report it upstream. Happy to answer questions or provide more context.
Environment
cypress-rspack-dev-server: 1.1.1cypress: 15.13.0@rspack/core: 1.7.7@rspack/dev-server: 1.2.1cypress open --component)Bug Description
When running component tests in interactive (open) mode, two 404 errors appear in the browser console on every spec run:
Tests still pass — the errors are non-blocking — but they produce noisy console output and could mask real issues.
Root Cause: contenthash filename mismatch after PR #41
PR #41 changed the output filename in
makeDefaultRspackConfig.js(line 31) from[name].jsto[name].[contenthash].jsto fix a chunk-loading conflict. However,loader.js(line 28) still hardcodes the URL without the content hash:But the actual compiled file is something like
spec-0.abc123def.js(with the content hash). So therelativeUrl404s because no file exists atspec-0.js.This doesn't break test execution because Cypress loads specs through the
shouldLoad()+ dynamicimport()mechanism in the loader, not through therelativeUrlfetch. But Cypress's runner does attempt to fetchrelativeUrl(likely for sourcemap resolution), producing the 404.Suggested fix
Either:
loader.jsto not hardcode.jsand instead derive the actual hashed filename from the compilation output[contenthash]from the filename template and find an alternative fix for the original chunk conflict that PR fix: avoid filename conflict #41 addressedSecondary issue:
iframes/undefinedrace conditionThe
/__cypress/iframes/undefined404 appears to be a timing issue where Cypress constructs the iframe URL beforespec.absoluteis populated. This may be related to thedev-server:compile:successevent being emitted (inCypressCTRspackPlugin.js:104) before the spec list is fully synchronized viadev-server:specs:changed. This only occurs in interactive mode — in headless/run mode,justInTimeCompilechanges the timing so specs are pre-compiled before the runner loads them.Reproduction
cypress-rspack-dev-serverwith any React project using rspackcypress open --componentThe errors do not appear when running headless (
cypress run --component).