Skip to content

SSR with <Suspense/> doesn't work anymore as it used to #1402

@BierDav

Description

@BierDav

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

The current behavior when using Suspense in ssr in 0.7.6 is that it renders the content in a <template/>

Let's look at this example I provided: https://codesandbox.io/p/github/BierDav/solid-start-ssr-bug/master

When we look at the working example at the network tab and preview the initial html provided we see everything looks fine:
image
The list is rendered and the style is applied

But on the not-working page, which uses a createResource, everything in the suspense is seamingly missing:
image

If we look closely than we see that the content of the Suspense can be found in the initial html, but it is contained in a template which makes it invisible in the preview and also in the initial view the user gets:
image

This is a different behaviour than in 0.3.10 from which I recently upgraded. Because in this version the result of Suspense is directly rendered in the body and this is what I expect because doing it the new way has two major disadvatages:

  1. The user again has to wait till the javascript kicks in, which kills all the advantage of ssr
  2. There are issues with methods like useAssets which makes libraries that heavily rely on this as for example suid unusable

Note:
I can be that the issue with useAssets in a <For/> is unrelated, but I was not sure and didn't want to make a second example. As you can see in the example, all the coffee entries are full width, because the css applied using useAssets which should make them 200px wide doesn't work in a <For/>

Expected behavior 🤔

I want that ssr works again as it already was, that it renders directly into the body and that useAssets does work even when used in a <For/>

Steps to reproduce 🕹

No response

Context 🔦

I want to point out that everything worked fine in 0.3.10, but they broke in the recent versions. I would really love a quick fix for that, because I have already ploughed up our whole codebase.

Your environment 🌎

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions