Preact: Issue on render

Created on 29 May 2020  路  5Comments  路  Source: preactjs/preact

This bug was introduced on 10.4.2. In 10.4.1 is working fine.

Preact 10.4.1 vs 10.4.2

image

Reproduction

I don't understand when it happens exactly. But look an error on SSR.

Steps to reproduce

  • clone the repo https://github.com/aralroca/preact-issue-report
  • yarn && yarn dev -> Is working fine
  • Upgrade Preact from 10.4.1 to 10.4.2 (or 10.4.4).
  • rm -rf node_modules yarn.lock && yarn && yarn dev -> Is not rendering well the content

Expected Behavior

Render the content in the same way than 10.4.1

Actual Behavior

It's not rendering the content.

Most helpful comment

It works very well now 馃憦

All 5 comments

There are some interesting things to see here, let me pop open the 10.4.1 dom-tree and compare it to the 10.4.2 one.

10.4.1

image

10.4.2

image

We can see that the debug measures kick in all of a sudden on 10.4.2 applying the __source, ... Is there an error being eaten somewhere?

The Preact-devtools are showing me that in 10.4.2 the props are all applied correctly as well.

image

Which is the exact same I'm seeing for 10.4.1, when I add an errorBoundary both seem to be behaving the same as well so for some reason it seems like there's something not applying.

I'll free up some time in a bit to dive deeper.

EDIT: this seems to be related to something wrong with the built- files since when I use a local instance of 10.4.2 there's nothing wrong this is highly peculiar.

@JoviDeCroock what I see is that it only happens on SSR. Using CSR is working fine 馃槙 Or at least using Next.js... Are you using SSR in your local instance?

BTW; What are the __self and __source doing? Are they only for devtools?

These are debug attributes originating from https://babeljs.io/docs/en/babel-plugin-transform-react-jsx-self, what I don't understand is why they weren't applied with 10.4.1 and they were with 10.4.2 the only change that could impact this is that starting at 10.4.2 we are actually using hydrate rather than render which in essence makes less sense.

EDIT: this feels very odd but it's all working for me atm with Preact 10.4.2 馃槄

This has been fixed in preact-render-to-string 5.1.9

It works very well now 馃憦

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zashy picture Zashy  路  3Comments

paulkatich picture paulkatich  路  3Comments

k15a picture k15a  路  3Comments

nopantsmonkey picture nopantsmonkey  路  3Comments

mizchi picture mizchi  路  3Comments