···2525 if (!map || code.includes(VITE_NODE_SOURCEMAPPING_SOURCE))
2626 return result
27272828- map.sources = map.sources?.map((source) => {
2929- if (!source)
2828+ if ('sources' in map) {
2929+ map.sources = map.sources?.map((source) => {
3030+ if (!source)
3131+ return source
3232+ // sometimes files here are absolute,
3333+ // but they are considered absolute to the server url, not the file system
3434+ // this is a bug in Vite
3535+ // all files should be either absolute to the file system or relative to the source map file
3636+ if (isAbsolute(source)) {
3737+ const actualPath = (!source.startsWith(withTrailingSlash(options.root)) && source.startsWith('/'))
3838+ ? resolve(options.root, source.slice(1))
3939+ : source
4040+ return relative(dirname(options.filepath), actualPath)
4141+ }
3042 return source
3131- // sometimes files here are absolute,
3232- // but they are considered absolute to the server url, not the file system
3333- // this is a bug in Vite
3434- // all files should be either absolute to the file system or relative to the source map file
3535- if (isAbsolute(source)) {
3636- const actualPath = (!source.startsWith(withTrailingSlash(options.root)) && source.startsWith('/'))
3737- ? resolve(options.root, source.slice(1))
3838- : source
3939- return relative(dirname(options.filepath), actualPath)
4040- }
4141- return source
4242- })
4343+ })
4444+ }
43454446 // to reduce the payload size, we only inline vite node source map, because it's also the only one we use
4547 const OTHER_SOURCE_MAP_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json[^,]+base64,([A-Za-z0-9+/=]+)$`, 'gm')