#HMR

19 messages · Page 1 of 1 (latest)

radiant stag
#

I don't how to diagnose this, I have a solid project, and i have a specfic tsx file, that saving it doesn't trigger HMR, server restart needed.
what should i look for?

radiant stag
#

don't know why, creating the tsx under diffrent name solved it.

unique timber
#

it's most likely that your import path's casing is different from the actual file name's casing. Make sure it's consistent

robust heath
#

@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

unique timber
robust heath
#

On a subsequent full page refresh it is still something

#

Like the whole file is not being build again by vite

unique timber
#

not sure. If it isn't a tsx file it's outside Solid Refresh's concern, so I cannot answer exactly

robust heath
#

This occurred first today, iirc, so I'm trying to eliminate changes hoping to find what triggered it

robust heath
#

thanks for the help regardless

robust heath
#

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

unique timber
#

No, server$ doesn't do anything special

robust heath
#

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);
unique timber