File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/vite/src/node/server/middlewares Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1+ import path from 'node:path'
12import colors from 'picocolors'
23import type { RollupError } from 'rollup'
34import type { Connect } from 'dep-types/connect'
45import strip from 'strip-ansi'
56import type { ErrorPayload } from 'types/hmrPayload'
67import { pad } from '../../utils'
78import type { ViteDevServer } from '../..'
9+ import { CLIENT_PUBLIC_PATH } from '../../constants'
810
911export function prepareError ( err : Error | RollupError ) : ErrorPayload [ 'err' ] {
1012 // only copy the information we need and avoid serializing unnecessary
@@ -82,7 +84,7 @@ export function errorMiddleware(
8284 '\\u003c' ,
8385 ) }
8486 try {
85- const { ErrorOverlay } = await import('/@vite/client' )
87+ const { ErrorOverlay } = await import(${ JSON . stringify ( path . posix . join ( server . config . base , CLIENT_PUBLIC_PATH ) ) } )
8688 document.body.appendChild(new ErrorOverlay(error))
8789 } catch {
8890 const h = (tag, text) => {
You can’t perform that action at this time.
0 commit comments