withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.59k stars 2.47k forks source link

🐛 BUG: Issue loading page with SolidJS after initial hydration #3791

Closed davedbase closed 2 years ago

davedbase commented 2 years ago

What version of astro are you using?

1.0.0-beta.61

Are you using an SSR adapter? If so, which one?

Cloudflare

What package manager are you using?

npm and yarn

What operating system are you using?

MacOS

Describe the Bug

On a number of occasions as I've been working with Astro I hit a scenario where the build seems to be brick itself. I'm using Builder.io Solid SDK, the Astro Solid adapter and a number of other packages (see dev list below). It seems that when I first run npm start the page loads fine but displays this in the console:

Screen Shot 2022-07-01 at 1 20 50 PM

Upon hard refreshing, the SSR process renders everything properly but Solid hydration doesn't kick in and the page has no interactivity because the client isn't loaded. The console then displays a different error:

Screen Shot 2022-07-01 at 1 19 23 PM

Here is a list of packages I have installed in case it's helpful:

{
   "devDependencies": {
    "@astrojs/partytown": "^0.1.2",
    "@astrojs/solid-js": "^0.2.0",
    "@astrojs/tailwind": "^0.2.1",
    "@astrojs/turbolinks": "^0.1.1",
    "@builder.io/sdk-solid": "^0.0.8-12",
    "astro": "^1.0.0-beta.61",
    "prettier": "^2.7.1",
    "prettier-plugin-astro": "^0.1.1"
  },
}

The odd thing is if I clear out node_modules and my lock file, then reinstall it works again and then breaks. I'm having trouble creating a reproduction or tracking down the issue.

Also I'm not sure if this is related but I'm noticing that the Solid integration has a peer and dev dependency for Solid with a different version. The gap between 1.3 and 1.4 contained breaking changes. I'm not sure but I suspect this could cause issues.

Link to Minimal Reproducible Example

Too difficult to reproduce, but I'm trying

Participation

unbiased-dev commented 2 years ago

Have you tried removing turbolinks? Ive had similar issues with turbolinks and hydration after navigations.

FredKSchott commented 2 years ago

The issue is most likely turbolinks, we actually deprecated that package due to incompatibilities with how Astro builds your scripts. See: https://www.npmjs.com/package/@astrojs/turbolinks