[ Client ] Could not Fast Refresh ("AuthContext" export is incompatible) in v ^0.18.1
Does anyone had this problem?
[ Client ] 14:06:23 [vite] (client) hmr invalidate /@fs/home/ofava/Escritorio/hominvestor/app/.wasp/out/sdk/wasp/dist/auth/forms/Auth.jsx Could not Fast Refresh ("AuthContext" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#consistent-components-exports3 Replies
Hi @tzefar. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Wohooo @tzefar, you just became a Waspeteer level 1!
----------------------
Yes, this is a known issue with Wasp when using Vite's Hot Module Replacement (HMR) and React Fast Refresh. The error occurs because the file
auth/forms/Auth.tsx (or its compiled .jsx output) exports something (like AuthContext) that is not a React component, which is incompatible with React Fast Refresh. As a result, instead of a hot update, the page will fully reload.
This issue is documented and is not blocking—your app will still work, but you lose the fast refresh experience for that module. The recommended fix is to split the file so that only React components are exported from files that participate in HMR, as described in the Vite plugin React documentation. The Wasp team is aware of this and may address it in a future update (see the issue discussion).
For now, you can safely ignore the warning, but if you want to resolve it yourself, consider refactoring your code so that context objects and non-component exports are separated from component exports in different files, following the guidance from the Vite plugin React documentation linked in the error message. This should restore proper Fast Refresh behavior for those modules.
More details can be found in the related Wasp GitHub issue: auth/forms/Auth.tsx exports are incompatible with React Fast Refresh.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @tzefar, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?