You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setup a brand new Astro + SolidJS project and wanted to use vitest to test out the components. I got it working but can't get rid of these dynamic import warnings that pop up whenever I run vitest:
11:01:24 PM [vite] warning:
/home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
256| await Promise.all(files.map(async (fsPath) => {
257| getWorkerState().moduleCache.delete(fsPath);
258| await import(fsPath);
11:01:24 PM [vite] warning:
/home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
279| const hash2 = browserHashMap.get(filepath);
280| if (match)
281| return await import(`/@fs/${filepath.slice(match[1].length)}?v=${hash2}`);
| ^
282| else
283| return await import(`${filepath}?v=${hash2}`);
The above dynamic import cannot be analyzed by vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
11:01:24 PM [vite] warning:
/home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
281| return await import(`/@fs/${filepath.slice(match[1].length)}?v=${hash2}`);
282| else
283| return await import(`${filepath}?v=${hash2}`);
| ^
284| }
285| for (const filepath of paths) {
The above dynamic import cannot be analyzed by vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
11:01:24 PM [vite] warning:
/home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
302| await importFromBrowser(filepath);
303| else
304| await import(filepath);
| ^
305| const defaultTasks = await defaultSuite.collect(file);
306| setHooks(file, getHooks(defaultTasks));
The above dynamic import cannot be analyzed by vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
Plugin: vite:import-analysis
File: /home/projects/github-b2yuz1/node_modules/vitest/dist/chunk-runtime-error.1104e45a.mjs
✓ test/Counter.test.tsx (1)
I am planning on doing some deeper digging into this to try to find the root cause of the issue, but figured someone else might have a better idea while I do that.
This should be fixed upstream in Vite at vitejs/vite#9738, which is now released at Vite 3.1.0-beta.0. You can try it out by using yarn resolutions (if you're using yarn) to override the Vite version used by Astro.
What version of
astro
are you using?1.0.6
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
yarn
What operating system are you using?
Windows
Describe the Bug
I have setup a brand new Astro + SolidJS project and wanted to use vitest to test out the components. I got it working but can't get rid of these dynamic import warnings that pop up whenever I run vitest:
Here is a StackBlitz with the issue reproduced: https://stackblitz.com/edit/github-b2yuz1
I am planning on doing some deeper digging into this to try to find the root cause of the issue, but figured someone else might have a better idea while I do that.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-b2yuz1
Participation
The text was updated successfully, but these errors were encountered: