#HMR
19 messages · Page 1 of 1 (latest)
don't know why, creating the tsx under diffrent name solved it.
it's most likely that your import path's casing is different from the actual file name's casing. Make sure it's consistent
@unique timber I'm experiencing a similar issue with a project that's essentially very comparable to the solid-start/prisma with auth example. Any changes in a /db/*.ts file trigger an HMR but it doesn't actually use the latest version. I verified the naming etc is consistent
hmm not sure with this one, I would assume that code is server-side only, but I'm just guessing. (A server-side only change doesn't propagate on the client, if the change itself doesn't have the HMR contract)
It is server side only code;
As a test, i console.log('something') inside the server side handler, when I change something to something1, the page refreshes, the server logs 'something' but expected would be 'something1'
On a subsequent full page refresh it is still something
Like the whole file is not being build again by vite
not sure. If it isn't a tsx file it's outside Solid Refresh's concern, so I cannot answer exactly
This occurred first today, iirc, so I'm trying to eliminate changes hoping to find what triggered it
Yeah I was hoping someone encountered this before :/
thanks for the help regardless
holdup, it may be solidjs related
I'm having the following code (simplified)
import { getFullAccount } from '~/db/account'
const fetchAccount = server$(getFullAccount);
export function routeData({ params }) {
// ...
const [account, { mutate }] = createResource(params.handle, async (handle) => {
// ...
const x = await fetchAccount(handle)
return x
}
// ...
return { account };
}
Reading the docs a bit, I can imagine that server$ can cause some build caching to happen?
A change in db/account.ts has no effect
When I restart the dev server, only the first change gets picked up
No, server$ doesn't do anything special
doesn't it compile to different client and server code, i.e. the server code holds a reference to the old function in memory, below feels smelly but when I wrap it in an anonymous function the behavior doesn't change
const fetchAccount = server$(getFullAccount);
yes it compiles into a different code, but like I said a propagation of change on the server doesn't mean it propagates as well on the client
That part I understand