Closed philldev closed 1 year ago
So I understand this is an HMR bug right.. It works on refresh and works when navigating around, just not on code save?
If so this might be a known issue with around context in HMR: https://github.com/solidjs/solid-refresh/issues/15
So I understand this is an HMR bug right.. It works on refresh and works when navigating around, just not on code save?
If so this might be a known issue with around context in HMR: solidjs/solid-refresh#15
oh yeah I have the similar issue.
I have found the workaround from https://github.com/solidjs/solid-refresh/issues/15
/* @refresh reload */
putting this comment on top of the file that have the Context code seems to be working for me. the undefined error did not appear and the code is updating correctly in browser
I found a better work around from https://github.com/vitejs/vite/issues/3301#issuecomment-1080030773. Seems like a Vite issue and
/* @refresh reload */
didn't work for me.
@xTye Yes, the superior workaround is to move createContext on a separate module alongside utilities to access that context instance.
Right now, those are the two known fixes, but the upcoming rewrite for Solid Refresh should fix the Context issue
I have the same problem where useContext(OrganizationContext)
will return undefined
on HMR.
solid-js: 1.7.12
solid-refresh: 0.5.2
However, it seems that this issue was marked as solved by PR #34
@xTye Yes, the superior workaround is to move createContext on a separate module alongside utilities to access that context instance.
Right now, those are the two known fixes, but the upcoming rewrite for Solid Refresh should fix the Context issue
Describe the bug
Here is the example code
Whenever I use useAppContext it will return undefined when I save the code, however it works fine when I refresh the browser
The issue is when i have to style the component I have to refresh the browser manually.
Is there any workaround for this issue? Thank you
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-wqdscb?file=src%2FApp.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
I don't have to refresh the browser manually to continue working on my code.
Screenshots or Videos
No response
Platform
Additional context
No response