Open timzolleis opened 2 months ago
Ugh. I thought I had resolved that issue. I guess it depends on how your code is set up.
I think the culprit is that the Remix Vite plugin will also load your SSR module and handle requests, at the same time the ExpressDevServer
plugin also hooks into the request pipeline.
This means that sometimes the Remix handler will process the request before my plugin can set up the context.
One option is to set Vite up in middleware
mode, which means I would have to create the dev server. Remix will not configure a handler if in middleware mode.
Details
2.10.2
0.4.4
0.4.4
Error description
Route loaders fail with the error
context.get() is not a function
at some point in the development process (this was, as far as I could see, completely random but happened at least once every 10 minutes)I logged context, and it is just an empty object in this case (default remix server AppLoadContext)
Additional details
I saw that this occured (at least what I could record) when either the root.tsx file itself changed, or imports in that root file (for example the css file):
Maybe this is caused by function exports in my root.tsx file? Since removing them, I was not able to observe the error again.
Thanks for the great package! I'll post updates here, if I'm able to provide some kind of reproduction.