solidjs / solid-start

SolidStart, the Solid app framework
https://start.solidjs.com
MIT License
5.14k stars 375 forks source link

[Bug?]: Hydration error on new project #1332

Closed gaearon closed 7 months ago

gaearon commented 8 months ago

Duplicates

Latest version

Current behavior 😯

npm init solid@latest

Result:

Screenshot 2024-02-14 at 11 13 54

Expected behavior 🤔

No mismatch in a fresh project

Steps to reproduce 🕹

See above

Context 🔦

Creating a project

Your environment 🌎

Node 18.19
macOS
emogua commented 8 months ago

I got the same error

zachlankton commented 8 months ago

Ah, yep, this is happening for me with new projects now too. Something pushed recently? I've tried rolling the version back in package.json, but that didn't work.

However if I copy this https://github.com/zachlankton/playing-with-server-components/blob/main/solidjs/package-lock.json lock file into the project and re-run npm install it works.

There are a few older dependencies in that lock file.

jchatard commented 8 months ago

Here's a repro. Crashing in pnpm dev but working in build mode.

AlbertSabate commented 8 months ago

I could narrow it down. The issue started from the bump of solid-refresh from v0.6.3 to v0.7.0.

Temporal fix:

"pnpm": {
    "overrides": {
      "solid-refresh": "0.6.3"
    }
  }

You guys can share if doing this fixes your hydration issue. It will be easier to find the root cause.

lxsmnsyc commented 8 months ago

temporary fix for now is to set the resolution for solid-refresh to 0.6.3

I still yet have to test the new refresh in Start, but things got a little unexpected domino effect.

ryansolid commented 8 months ago

Vite Plugin Solid did an update that grabbed the latest Solid Refresh that introduces a new granular HMR stragety. The range in Solid Start is only locked to the nearest major in Start and it broke everything. I'm going to set the range to minor in Start and we can test the new Vite plugin. Sorry for the inconvenience.

ryansolid commented 8 months ago

v0.5.7 is now released that locks the version to minor version of vite-plugin-solid. Development of new Solid Start projects now won't be affected while we track down the issue with Solid Refresh.

elite174 commented 8 months ago

The same thing happens with

    "@solidjs/router": "0.12.4",
    "@solidjs/start": "0.5.10",
    "solid-js": "1.8.15",
    "vinxi": "0.3.3"

Any updates?

elite174 commented 8 months ago

UPDATE: fixed this with using Suspense in app.tsx

ryansolid commented 7 months ago

We are still testing the new Refresh plugin I'm going to consider this one closed because we already reverted the broken build. We will worry about the new Refresh plugin when it is ready.