File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { parseAst } from 'rollup/parseAst'
1212import type { StaticImport } from 'mlly'
1313import { ESM_STATIC_IMPORT_RE , parseStaticImport } from 'mlly'
1414import { makeLegalIdentifier } from '@rollup/pluginutils'
15- import type { PartialResolvedId } from 'rollup'
15+ import type { PartialResolvedId , RollupError } from 'rollup'
1616import type { Identifier , Literal } from 'estree'
1717import {
1818 CLIENT_DIR ,
@@ -348,7 +348,12 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
348348 }
349349 }
350350
351- const resolved = await this . resolve ( url , importerFile )
351+ const resolved = await this . resolve ( url , importerFile ) . catch ( ( e ) => {
352+ if ( e instanceof Error ) {
353+ ; ( e as RollupError ) . pos ??= pos
354+ }
355+ throw e
356+ } )
352357
353358 if ( ! resolved || resolved . meta ?. [ 'vite:alias' ] ?. noResolved ) {
354359 // in ssr, we should let node handle the missing modules
You can’t perform that action at this time.
0 commit comments