File tree 1 file changed +3
-1
lines changed
packages/vite/src/node/server/middlewares
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change
1
+ import path from 'node:path'
1
2
import colors from 'picocolors'
2
3
import type { RollupError } from 'rollup'
3
4
import type { Connect } from 'dep-types/connect'
4
5
import strip from 'strip-ansi'
5
6
import type { ErrorPayload } from 'types/hmrPayload'
6
7
import { pad } from '../../utils'
7
8
import type { ViteDevServer } from '../..'
9
+ import { CLIENT_PUBLIC_PATH } from '../../constants'
8
10
9
11
export function prepareError ( err : Error | RollupError ) : ErrorPayload [ 'err' ] {
10
12
// only copy the information we need and avoid serializing unnecessary
@@ -82,7 +84,7 @@ export function errorMiddleware(
82
84
'\\u003c' ,
83
85
) }
84
86
try {
85
- const { ErrorOverlay } = await import('/@vite/client' )
87
+ const { ErrorOverlay } = await import(${ JSON . stringify ( path . posix . join ( server . config . base , CLIENT_PUBLIC_PATH ) ) } )
86
88
document.body.appendChild(new ErrorOverlay(error))
87
89
} catch {
88
90
const h = (tag, text) => {
You can’t perform that action at this time.
0 commit comments