Skip to content

fix: avoid filename conflict#41

Merged
xfsnowind merged 2 commits into
th3fallen:mainfrom
Thebarda:fix-output-name
Jun 17, 2025
Merged

fix: avoid filename conflict#41
xfsnowind merged 2 commits into
th3fallen:mainfrom
Thebarda:fix-output-name

Conversation

@Thebarda

Copy link
Copy Markdown

This fixes a 'Loading chunk error' issue that happens sometimes in the CI. The test is running correctly but sometimes the test fails to load the test file in the CI.

@xfsnowind xfsnowind self-requested a review June 15, 2025 02:56
@xfsnowind

Copy link
Copy Markdown
Collaborator

Need to run pnpm build to update the dist file

@Thebarda

Copy link
Copy Markdown
Author

Need to run pnpm build to update the dist file

Thanks. Done ✅

@xfsnowind xfsnowind merged commit d4ce53a into th3fallen:main Jun 17, 2025
4 checks passed
robcmills added a commit to robcmills/cypress-rspack-dev-server that referenced this pull request Apr 2, 2026
…eractive mode

The contenthash in output.filename (added in PR th3fallen#41) caused a mismatch
with the hardcoded relativeUrl in loader.ts, resulting in 404 errors for
spec files in interactive mode (cypress open). The contenthash cannot be
resolved at loader time since the hash depends on the compilation output.
Reverting to [name].js since cache busting via filename hashing is
unnecessary for a dev server.

Closes th3fallen#45

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
robcmills added a commit to robcmills/cypress-rspack-dev-server that referenced this pull request Apr 2, 2026
PR th3fallen#41 added [contenthash] to the output filename to fix intermittent
"Loading chunk" errors in CI. However, this caused a mismatch with the
hardcoded relativeUrl in loader.ts, producing 404 errors in interactive
mode (cypress open).

The contenthash cannot be resolved at loader time since the hash depends
on compilation output which includes the loader output — a circular
dependency. The real fix for chunk loading conflicts is output.uniqueName,
which namespaces the chunk loading runtime to prevent collisions between
the app's rspack/webpack instance and Cypress's, without requiring
filename hashing.

Closes th3fallen#45

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
xfsnowind pushed a commit that referenced this pull request Apr 9, 2026
…ve mode (#46)

* fix: remove contenthash from output filename to fix 404 errors in interactive mode

The contenthash in output.filename (added in PR #41) caused a mismatch
with the hardcoded relativeUrl in loader.ts, resulting in 404 errors for
spec files in interactive mode (cypress open). The contenthash cannot be
resolved at loader time since the hash depends on the compilation output.
Reverting to [name].js since cache busting via filename hashing is
unnecessary for a dev server.

Closes #45

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: replace contenthash with uniqueName to fix 404s in interactive mode

PR #41 added [contenthash] to the output filename to fix intermittent
"Loading chunk" errors in CI. However, this caused a mismatch with the
hardcoded relativeUrl in loader.ts, producing 404 errors in interactive
mode (cypress open).

The contenthash cannot be resolved at loader time since the hash depends
on compilation output which includes the loader output — a circular
dependency. The real fix for chunk loading conflicts is output.uniqueName,
which namespaces the chunk loading runtime to prevent collisions between
the app's rspack/webpack instance and Cypress's, without requiring
filename hashing.

Closes #45

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use webpackChunkName magic comment instead of rspackChunkName

Rspack recognizes webpackChunkName (for webpack compatibility) but not
rspackChunkName. This caused chunks to get auto-generated names (e.g.
component_Test_cy_tsx) instead of the intended names (spec-0), making
the hardcoded relativeUrl in the loader 404.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: revert unrelated snapshot change

Restore Symbol(shapeMode) line in snapshot to match main — the removal
was caused by a local Node.js version difference and is unrelated to
the contenthash fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants