T
TanStack7mo ago
xenial-black

is HMR supposed to be working?

I see this PR was merged recently https://github.com/TanStack/router/pull/2316 and a few others, but HMR definitely is not working for my app running 1.102.2
9 Replies
xenial-black
xenial-black7mo ago
im having same issue HMR not working cause preamble isn't loaded in
stormy-gold
stormy-gold7mo ago
@succatash related? https://github.com/TanStack/router/issues/3328 HMR mostly works in my app, but there's certain pages, that when hard reload, I get that error on.
GitHub
HMR issue when refresh-runtime hasn't finished initializing · Issue...
Which project does this relate to? Start Describe the bug First of all, I would like to say thank you for HMR support in Start — it's great. Today I found a new issue with @vite/plugin-react er...
stormy-gold
stormy-gold7mo ago
What's interesting is the __vite_plugin_react_preamble_installed__ is initially set on load, but something is removing it resulting in the error, which then breaks other things from loading on the page, so queries dont work, etc.
fascinating-indigo
fascinating-indigo7mo ago
maybe that's a hydration issue. can you please provide me with the HTML before and after hydration? so just the HTML that the server responded with and the HTML after the error occured by getting it from the dom explorer in the devtools
stormy-gold
stormy-gold7mo ago
Hah, I just did this, and I see an exception in the SSR that I wasn't see anywhere else: https://gist.github.com/ambethia/ae11010bcc3b519e257550915cb1141e
Gist
DOM
GitHub Gist: instantly share code, notes, and snippets.
stormy-gold
stormy-gold7mo ago
The Clerk <SignoutButton> is the culprit, accessing window
xenial-black
xenial-black7mo ago
@OMFG Pandas! sort of i had to make the script tag with the preamble{object} async:true and it worked. This was for the Deno Runtime.
scripts: [
{
children: `import RefreshRuntime from "/_build/@react-refresh";
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true;
`,
type: 'module',
suppressHydrationWarning: true,
async: true,
},
],
scripts: [
{
children: `import RefreshRuntime from "/_build/@react-refresh";
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true;
`,
type: 'module',
suppressHydrationWarning: true,
async: true,
},
],
stormy-gold
stormy-gold7mo ago
Ah, the <SignoutButton> was a false alarm anyways, it's something else.
xenial-black
xenial-black7mo ago
lol just got HMR working and u pushed a PR

Did you find this page helpful?