Skip to content

Commit

Permalink
fix: wait for optimized dependency to be bundled in non-pnpm package …
Browse files Browse the repository at this point in the history
…managers
  • Loading branch information
sheremet-va committed Feb 25, 2023
1 parent 6e4ccdf commit d2460b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vite-node/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ export class ViteNodeServer {

const cacheDir = this.options.deps?.cacheDir

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

0 comments on commit d2460b7

Please sign in to comment.