We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 401647f commit 2aee2ebCopy full SHA for 2aee2eb
packages/vite/src/node/server/pluginContainer.ts
@@ -445,6 +445,21 @@ export async function createPluginContainer(
445
}
446
447
448
+ } else if (err.loc) {
449
+ if (!err.frame) {
450
+ let code = err.pluginCode
451
+ if (err.loc.file) {
452
+ err.id = normalizePath(err.loc.file)
453
+ if (!code) {
454
+ try {
455
+ code = fs.readFileSync(err.loc.file, 'utf-8')
456
+ } catch {}
457
+ }
458
459
+ if (code) {
460
+ err.frame = generateCodeFrame(code, err.loc)
461
462
463
464
return err
465
0 commit comments