SolidJSS
SolidJSโ€ข3y agoโ€ข
4 replies
Bersaelor

Context is undefined during development reloads

So I use a few contexts like:

const useAppState = () => { return useContext(AppContext)! }


this worked fine for a while now, since I make sure to always wrap components that use it into the correct providers.

For about a week now, when using
npm run dev
when I make small changes ot my code (just a linebreak for example) and save, my browser running localhost:3000 will have a:

Cannot destructure property 'userDetails' of 'useAppState(...)' as it is undefined.


I then have to manually reload the page in the browser to see the change. This is a little annoying since I like to see visual layout changes immedieately on my second screen while I adjust the code, now I always have to mouse over to reload the page.

What could be causing this? I mean it all runs perfectly well as a whole site, just the little live updates break it?
Was this page helpful?