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

Fast refresh not working with vite (defonce in REPL mode) #572

Closed
ianchow opened this issue Nov 5, 2024 · 0 comments
Closed

Fast refresh not working with vite (defonce in REPL mode) #572

ianchow opened this issue Nov 5, 2024 · 0 comments

Comments

@ianchow
Copy link

ianchow commented Nov 5, 2024

It seems vite is doing a page reload:

09:12:23 [vite] hmr invalidate /js/my_component.jsx Could not Fast Refresh ("MyComponent" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports
09:12:23 [vite] page reload js/my_component.jsx

so that's the culprit
I think the REPL output isn't compatible with how the vite react plugin works. If I massage the output slightly like:
export var MyComponent
then it works again.

borkdude added a commit that referenced this issue Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant