Skip to content

Commit

Permalink
fix: avoid null sourcePath in server.sourcemapIgnoreList (#12251)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev authored Mar 1, 2023
1 parent 9885f6f commit 209c3bd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/vite/src/node/server/transformRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ async function loadAndTransform(
++sourcesIndex
) {
const sourcePath = map.sources[sourcesIndex]
if (!sourcePath) continue

const sourcemapPath = `${mod.file}.map`
const ignoreList = config.server.sourcemapIgnoreList(
Expand All @@ -298,11 +299,7 @@ async function loadAndTransform(
// Rewrite sources to relative paths to give debuggers the chance
// to resolve and display them in a meaningful way (rather than
// with absolute paths).
if (
sourcePath &&
path.isAbsolute(sourcePath) &&
path.isAbsolute(mod.file)
) {
if (path.isAbsolute(sourcePath) && path.isAbsolute(mod.file)) {
map.sources[sourcesIndex] = path.relative(
path.dirname(mod.file),
sourcePath,
Expand Down

0 comments on commit 209c3bd

Please sign in to comment.