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
My Vite configuration (vite.config.ts) is the following:
import { defineConfig } from 'vite';
import viteReact from '@vitejs/plugin-react';
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
export default defineConfig({
plugins: [TanStackRouterVite(), viteReact()],
server: {
open: true,
port: 3000,
},
});
I am running this script locally in VSCode and within Github actions: vitest run --browser.headless and getting the following output.
RUN v3.0.3
✓ node src/**/*.node.test.ts (1 test) 4ms
[vite] (client) ✨ new dependencies optimized: react/jsx-dev-runtime
[vite] (client) ✨ optimized dependencies changed. reloading
[vitest] Vite unexpectedly reloaded a test. This may cause tests to fail, lead to flaky behaviour or duplicated test runs.
For a stable experience, please add mentioned dependencies to your config's `optimizeDeps.include` field manually.
✓ browser src/**/*.browser.test.tsx (2 tests) 193ms
Test Files 2 passed (2)
Tests 3 passed (3)
Duration 11.85s (transform 93ms, setup 3.60s, collect 4.00s, tests 197ms, environment 0ms, prepare 2.61s)
As you can see, I am getting a warning about react/jsx-dev-runtime, but after adding this to the optimizeDeps.include in vite.config.ts and vitest.config.ts, not at the same time, but separately, it does not cause the warning to go away.
I have tried to read the about the dependency pre-bundling here: https://vite.dev/guide/dep-pre-bundling.html, but with my lack of knowledge in this area, it wasn't able to provide enough to help me figure out what could be happening.
If anyone could give me a solution or even just a step in the right direction to get there, that would be much appreciated :)
Reproduction
I think the above is enough for now - can provide more information if need be.
Hello @DG-DylD. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.
There is definitely an issue with my specific configuration, albeit with my configuration or the packages themselves, but I could not get a StackBlitz working, so this will not be able to be taken any further, so closing this issue.
Describe the bug
I am running my node and browser tests within Vitest using this configuration (
vitest.config.ts
):My Vite configuration (
vite.config.ts
) is the following:I am running this script locally in VSCode and within Github actions:
vitest run --browser.headless
and getting the following output.As you can see, I am getting a warning about
react/jsx-dev-runtime
, but after adding this to theoptimizeDeps.include
invite.config.ts
andvitest.config.ts
, not at the same time, but separately, it does not cause the warning to go away.I have tried to read the about the dependency pre-bundling here: https://vite.dev/guide/dep-pre-bundling.html, but with my lack of knowledge in this area, it wasn't able to provide enough to help me figure out what could be happening.
If anyone could give me a solution or even just a step in the right direction to get there, that would be much appreciated :)
Reproduction
I think the above is enough for now - can provide more information if need be.
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: