Skip to content

Commit 436c3d8

Browse files
authored
chore: improve chunk error logging (#13799)
1 parent 1057f85 commit 436c3d8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/nine-eyes-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Improve chunk error logging when a chunk cannot be found during the build

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@
365365
- ThornWu
366366
- tiborbarsi
367367
- timdorr
368+
- timfisher
368369
- TkDodo
369370
- tkindy
370371
- tlinhart

packages/react-router-dev/vite/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ const getReactRouterManifestBuildAssets = (
331331
prependedAssetFilePaths: string[] = []
332332
): ReactRouterManifest["entry"] & { css: string[] } => {
333333
let entryChunk = resolveChunk(ctx, viteManifest, entryFilePath);
334-
invariant(entryChunk, "Chunk not found");
334+
invariant(entryChunk, `Chunk not found: ${entryFilePath}`);
335335

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

0 commit comments

Comments
 (0)