Skip to content

Commit

Permalink
fix: import @vite/client in browser code for handling optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Mar 20, 2023
1 parent 8294811 commit 20c510c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/browser/src/client/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ ws.addEventListener('open', async () => {

let hasSnapshot = false
async function runTests(paths: string[], config: any, client: VitestClient) {
// need to import it before any other import, otherwise Vite optimizer will hang
const viteClientPath = '/@vite/client'
await import(viteClientPath)

// we use dynamic import here, because this file is bundled with UI,
// but we need to resolve correct path at runtime
const path = '/__vitest_index__'
Expand Down

0 comments on commit 20c510c

Please sign in to comment.