Skip to content
Source
Sign inSign up
TanStack/router

fix(solid-start): fix hydration regression in 1.136.9 #5903

Mergedbirkskyum(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/5903/headmerged by birkskyum(GitHub profile, opens in a new tab)

Showing 1 changed file with 1 addition and 1 deletion.

x
0 of 1 viewed, 1 left
1 addition and 1 deletionpackages/solid-router/src/Asset.tsxModified
View file
@@ -125,7 +125,7 @@
​
if (!router.isServer) {
// render an empty script on the client just to avoid hydration errors
Thread on line 127

⚠️ Potential issue | 🟡 Minor

Update the comment to match the new behavior.

The comment states "render an empty script on the client just to avoid hydration errors", but the code now returns null instead of an empty script tag.

Apply this diff to update the comment:

-    // render an empty script on the client just to avoid hydration errors
+    // render nothing on the client to match server-side behavior and avoid hydration errors
📝 Committable suggestion

‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    // render nothing on the client to match server-side behavior and avoid hydration errors
🤖 Prompt for AI Agents
In packages/solid-router/src/Asset.tsx around line 127, update the inline
comment which currently reads "render an empty script on the client just to
avoid hydration errors" to reflect the new behavior: the component now returns
null on the client to avoid hydration errors; change the comment to something
like "return null on the client to avoid hydration errors" so it matches the
code.
- return <script />
+ return null
​
if (attrs?.src && typeof attrs.src === 'string') {