Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the 'root' configuration is set to something other than the default, hot reload doesn't work #24

Open
Arthur944 opened this issue Jun 1, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Arthur944
Copy link

Arthur944 commented Jun 1, 2023

Potential solution

I was able to get this to work by adding { root: '.' } in previewServer.mjs to the createServer call
image

Describe the bug

Hot reload doesn't work if the 'root' option is configured to something other than the default in vite.config.ts.

Reproduce

Take the example project, change the 'root' field in vite.config.ts to something else (like "test-root"). Change the 'root' field to '.' in the test.root option so that tests still work. Run vitest-preview and run a test.

https://stackblitz.com/edit/vitest-preview-9hat82?file=src%2FApp.test.tsx

Expected behavior

vitest-preview should hot reload, but it doesn't. You only see the results after a refresh.

@Arthur944 Arthur944 added the bug Something isn't working label Jun 1, 2023
@nvh95 nvh95 added this to the 0.0.2 milestone Jul 26, 2023
@nvh95 nvh95 self-assigned this Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants