Skip to content

Commit d2460b7

Browse files
committedFeb 25, 2023
fix: wait for optimized dependency to be bundled in non-pnpm package managers
1 parent 6e4ccdf commit d2460b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎packages/vite-node/src/server.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ export class ViteNodeServer {
150150

151151
const cacheDir = this.options.deps?.cacheDir
152152

153-
if (cacheDir && id.includes(cacheDir) && !id.includes(this.server.config.root)) {
154-
id = join(this.server.config.root, id)
153+
if (cacheDir && id.includes(cacheDir)) {
154+
if (!id.startsWith(this.server.config.root))
155+
id = join(this.server.config.root, id)
155156
const timeout = setTimeout(() => {
156157
throw new Error(`ViteNodeServer: ${id} not found. This is a bug, please report it.`)
157158
}, 5000) // CI can be quite slow

0 commit comments

Comments
 (0)
Please sign in to comment.