Skip to content

Commit

Permalink
fix: throw ssr import error directly (fix vitejs#12322)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Mar 7, 2023
1 parent 108aadf commit 12af613
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/ssr/ssrModuleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ async function nodeImport(
try {
const mod = await dynamicImport(url)
return proxyESM(mod)
} catch {}
} catch (err) {
err.message = `\nFailed to import ${url} from ${importer}\n${err.message}`

throw err
}
}

// rollup-style default import interop for cjs
Expand Down

0 comments on commit 12af613

Please sign in to comment.