preactjs / preact

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
https://preactjs.com
MIT License
36.78k stars 1.95k forks source link

issue when using webpack-hot-middleware #2453

Closed davixyz closed 2 years ago

davixyz commented 4 years ago

Reproduction

Can't share my repo as it's internal on the company but we are using https://github.com/webpack-contrib/webpack-hot-middleware To hot reload the app; We upgraded to version 10.3.4of preact and everything worked just fine, but on version 10.4.0 something is making the __webpack_hmr event to hang indefinitely.

Did anything related to webpack processing changed? I know this is a longshot but I wanted to see if something changed.

Expected Behavior

Our app to load!

Actual Behavior

Our app never loads and it hangs in there indefinitely.

Feel free to close if it's too vague, for now we'll probably lock to 10.3.4

JoviDeCroock commented 4 years ago

@davixyz is this issue meant for preact-cli since this repo has nothing to do with webpack processing

davixyz commented 4 years ago

Hi @JoviDeCroock I know it's a bit of a long shot, but basically we are trying to upgrade to v10+ (coming from 8) and when we try 10.3.4 with our hot reloader, everything works; When we try the same with 10.4.0 the app hangs and hot reloader never finishes. Not sure what's the issue if the only change is the preact version hence asking here but if it's not applicable we can close. I'll keep searching on my end since this is pretty strange

JoviDeCroock commented 4 years ago

I think the only PR that could affect it a bit would be this https://github.com/preactjs/preact/pull/2386 but that would make the updates be stale in the worst case scenario so I can't actually see any erroneous case in this changelog. I'll study the other codebase

Scanned the codebase real quick and there ddon't seem to be any blockers :/

wintercounter commented 4 years ago

We don't know if our problem is related to this, but since 10.4.0 our Lazy components stopped working, nothing is rendered, and we need to resize our browser horizontally (!) to make it rendered. It's a simple Suspense + Lazy. We did try with returning a simple string only in our Lazy component, not working. With 10.3.4 everything's fine. Something is definitely wrong with the new version. We're still investigating, I'll post new details later/create new issue if we know more. (We're using compat).

JoviDeCroock commented 4 years ago

@wintercounter if your issue isn’t related to webpack-hor-middleware, please make a new issue reproducing the bug. These don’t seem related and it risks becoming lost information.

wintercounter commented 4 years ago

As I said I'll open new issue once I have enough info and repro, but at the moment I don't have time, so I thought to share some info, maybe it helps as the issue is directly related to the mentioned PR most probably. Sorry for that...

JoviDeCroock commented 4 years ago

No problem at all, just making sure we can correctly help you out as well.

davixyz commented 4 years ago

Just to comment, we also load lazily our components using https://github.com/faceyspacey/react-universal-component; I'll try to make something as well to see if I can reproduce