Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/nine-eyes-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-router/dev": patch
---

Improve chunk error logging when a chunk cannot be found during the build
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@
- ThornWu
- tiborbarsi
- timdorr
- timfisher
- TkDodo
- tkindy
- tlinhart
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ const getReactRouterManifestBuildAssets = (
prependedAssetFilePaths: string[] = []
): ReactRouterManifest["entry"] & { css: string[] } => {
let entryChunk = resolveChunk(ctx, viteManifest, entryFilePath);
invariant(entryChunk, "Chunk not found");
invariant(entryChunk, `Chunk not found: ${entryFilePath}`);

// This is here to support prepending client entry assets to the root route
let prependedAssetChunks = prependedAssetFilePaths.map((filePath) => {
let chunk = resolveChunk(ctx, viteManifest, filePath);
invariant(chunk, "Chunk not found");
invariant(chunk, `Chunk not found: ${filePath}`);
return chunk;
});

Expand Down