Skip to content

Commit

Permalink
fix(repack): skip chunks that have no files associated with them (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbroma committed Apr 24, 2023
1 parent d81c499 commit 2180c09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-flies-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": patch
---

Fix OutputPlugin issue where chunks have no associated files with them
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ export class AssetsCopyProcessor {

// Chunk bundle e.g: `index.bundle`, `src_App_js.chunk.bundle`
const [chunkFile] = [...chunk.files];

// Sometimes there are no files associated with the chunk and the OutputPlugin fails
// Skipping such chunks is a temporary workaround resulting in proper behaviour
// TODO: determine the real cause of this issue
if (!chunkFile) {
return;
}

const relatedSourceMap =
compilation.assetsInfo.get(chunkFile)?.related?.sourceMap;
// Source map for the chunk e.g: `index.bundle.map`, `src_App_js.chunk.bundle.map`
Expand Down

0 comments on commit 2180c09

Please sign in to comment.