Skip to content

Commit

Permalink
fix: assetsInfo may be undefined (rspack) (#1927)
Browse files Browse the repository at this point in the history
  • Loading branch information
inottn authored Aug 20, 2024
1 parent 0034dd9 commit 21f1797
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/utils/getFilenameFromUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ function getFilenameFromUrl(context, url, extra = {}) {
if (extra.stats.isFile()) {
foundFilename = filename;

const assetInfo = assetsInfo.get(
pathname.slice(publicPathObject.pathname.length),
);
// Rspack does not yet support `assetsInfo`, so we need to check if `assetsInfo` exists here
if (assetsInfo) {
const assetInfo = assetsInfo.get(
pathname.slice(publicPathObject.pathname.length),
);

extra.immutable = assetInfo ? assetInfo.immutable : false;
extra.immutable = assetInfo ? assetInfo.immutable : false;
}

break;
} else if (
Expand Down

0 comments on commit 21f1797

Please sign in to comment.