Skip to content

Commit

Permalink
fix(ssr): strip NULL_BYTE_PLACEHOLDER before import (#9124)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Jul 18, 2022
1 parent d66ffd0 commit c5f2dc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/ssr/ssrModuleLoader.ts
Expand Up @@ -137,7 +137,8 @@ async function instantiateModule(
if (dep[0] !== '.' && dep[0] !== '/') {
return nodeImport(dep, mod.file!, resolveOptions)
}
dep = unwrapId(dep)
// convert to rollup URL because `pendingImports`, `moduleGraph.urlToModuleMap` requires that
dep = unwrapId(dep).replace(NULL_BYTE_PLACEHOLDER, '\0')
if (!isCircular(dep) && !pendingImports.get(dep)?.some(isCircular)) {
pendingDeps.push(dep)
if (pendingDeps.length === 1) {
Expand Down

0 comments on commit c5f2dc7

Please sign in to comment.