Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
- briankb
- BrianT1414
- Bricklou
- brillout
- brockross
- brookslybrand
- brophdawg11
Expand Down
7 changes: 6 additions & 1 deletion packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3540,7 +3540,12 @@ export async function getEnvironmentOptionsResolvers(
: viteUserConfig.build?.rollupOptions?.input) ??
virtual.serverBuild.id,
output: {
entryFileNames: serverBuildFile,
entryFileNames({ name }) {
return name === "virtual_react-router/server-build"
Copy link
Contributor

@pcattori pcattori Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For onlookers: our server build virtual module (virtual:react-router/server-build) gets sanitized via Rollup's sanitizeFilename which replaces the : with _

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some tests are failing because the name ends up being server-build rather than virtual_react-router/server-build

Copy link
Contributor

@pcattori pcattori Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brillout was virtual_react-router/server-build working for you? I just changed it to server-build and now most tests are passing for me locally. Trying to figure out when we should expect virtual_react-router/server-build vs just `server-build.

Suggested change
return name === "virtual_react-router/server-build"
return name === "server-build"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the reproduction I linked to, the name is virtual_react-router/server-build. Maybe name === "server-build" || name === "virtual_react-router/server-build" or name.endsWith("server-build") then?

Btw. I guess this change should also be applied to other entryFileNames usage. I just did the minimal amount of changes to fix the reproduction. (I'm inclined to think it's better the React Router team takes over the PR.)

? serverBuildFile
: // Rollup's default
"[name].js";
},
format: serverModuleFormat,
},
},
Expand Down
Loading