Preact-cli: App doesn't render properly with preact build --no-prerender

Created on 26 Feb 2020  Â·  9Comments  Â·  Source: preactjs/preact-cli

Do you want to request a _feature_ or report a _bug_?
Report a bug

What is the current behaviour?
Added the --no-prerender flag to build script but realised deployed app does not render properly.
See example here: https://nfc-reader-ku2p1w642.now.sh/

If the current behaviour is a bug, please provide the steps to reproduce.

  • Create a preact project using default template
  • Change build script to "preact build --no-prerender" in package.json
  • Deploy

What is the expected behaviour?
App should render normally as per demo preact app.

Most helpful comment

Yay! It works! Thanks :D

All 9 comments

what version of @preact/async-loader are you on?

@prateekbh Seems to be v 3.0.0-rc.9 as taken from node_modules/@preact/async-loader folder of my project.

{
  "name": "@preact/async-loader",
  "version": "3.0.0-rc.9",
  "description": "Preact's async component loader for Webpack",
  "files": [
    "*.js"
  ],
  "engines": {
    "node": ">=6"
  },
  "dependencies": {
    "kleur": "^3.0.3",
    "loader-utils": "^1.1.0"
  },
  "peerDependencies": {
    "preact": "^8.1.0"
  },
  "gitHead": "ef9af643837a7a94f9d2d683c36a549c8b710ec2"
}

I think I'm experiencing this bug too with 3.0.0-rc.9 🤔

How can I help in reproducing it?

Based on observation, this seems to only affect the class CSS styles in the Header component for some reason. When I inspected the header element in browser, all the DOM elements in header do not have any classes, hence the styles are missing.
The CSS styles for the route components like home/about seems to work as expected.

Can you please check my repo (live
at steffo.eu)?

I think the same thing is happening to my Box component...

On Sun, Mar 8, 2020, 19:38 Jason Zheng notifications@github.com wrote:

Based on observation, this seems to only affect the class CSS styles in
the Header component for some reason. When I inspected the header element
in browser, all the DOM elements in header do not have any classes, hence
the styles are missing.
The CSS styles for the route components like home/about seems to work as
expected.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/preactjs/preact-cli/issues/1017?email_source=notifications&email_token=AALYGFNLZYDBI6PHDCZQAQLRGPQ2TA5CNFSM4K4ME6NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOE5UDY#issuecomment-596236815,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALYGFNCL26GGQYSSJXDN5TRGPQ2TANCNFSM4K4ME6NA
.

Will do

we have the fix in, will be releasing a version that should fix this.
by EOW

should be fixed with rc.10.

Happy to re-open if it still persist

Yay! It works! Thanks :D

Was this page helpful?
0 / 5 - 0 ratings