Build with --no-prerender flag is broken
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behaviour?
When you build a project with preact build --no-prerender
the css is not applied to the components.
If the current behaviour is a bug, please provide the steps to reproduce.
- Clone https://github.com/tadejstanic/test-preact
- Have preact-cli v3.0.0-rc.8
- Run
preact build --no-prerender
- Test build with
npx serve build
You will see the css is not applied.
If you run preact build
and then test the build you’ll see the right output.
What is the expected behaviour? A fully functional production build.
Please mention other relevant information.
The project was created form preact typescript template - preact create typescript
Please paste the results of preact info
here.
System:
OS: macOS 10.15.3
CPU: (8) x64 Intel® Core™ i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
Yarn: 1.21.1 - ~/.yarn/bin/yarn
npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
Browsers:
Chrome: 80.0.3987.106
Firefox: 72.0.2
Safari: 13.0.5
npmPackages:
preact: ^10.3.1 => 10.3.1
preact-cli: ^3.0.0-next.19 => 3.0.0-rc.8
preact-render-to-string: ^5.1.4 => 5.1.4
preact-router: ^3.2.1 => 3.2.1
npmGlobalPackages:
preact-cli: 3.0.0-rc.8
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (5 by maintainers)
Top GitHub Comments
@prateekbh I couldn’t find that library. I assume you were talking about @preact/async-loader? I updated that one, and it didn’t help.
Nevertheless I found where the problem is.
root.tagName = 'SCRIPT'
(uppercase) when we have the--no-prererender
flag, so theroot.tagName === 'script'
condition isfalse
. Doing something likeroot.tagName.toLowerCase() === 'script'
fixes it.thats a nice catch… mind sending the PR?