squint-cljs / squint

Light-weight ClojureScript dialect
https://squint-cljs.github.io/squint
676 stars 44 forks source link

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

Closed ianchow closed 3 weeks ago

ianchow commented 3 weeks ago

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.