question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build with --no-prerender flag is broken

See original GitHub issue

Do 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.

  1. Clone https://github.com/tadejstanic/test-preact
  2. Have preact-cli v3.0.0-rc.8
  3. Run preact build --no-prerender
  4. 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Kokanmcommented, Feb 18, 2020

@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 the root.tagName === 'script' condition is false. Doing something like root.tagName.toLowerCase() === 'script' fixes it.

2reactions
prateekbhcommented, Feb 18, 2020

thats a nice catch… mind sending the PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

XC16 v1.21 linker flag "nodefaultlibs" breaks build
I'm trying to omit the standard libraries for a safety-critical project. Setting the nodefaultlibs cause the build to fail.
Read more >
conditionally running tests with build flags not working
To avoid running this in every iteration I've set up the // +build slow flag. This should only run when doing go test...
Read more >
Buying vs. building a feature flagging system - LaunchDarkly
Breaking down the Build vs Buy dilemma ... Additionally, tech debt and “sunsetted” feature flags clog up teams' code and make feature management...
Read more >
Configuring Build Environment - Gentoo Development Guide
Ebuilds must not simply ignore user CFLAGS, CXXFLAGS or LDFLAGS — see Not Filtering Variables. Guidelines for Flag Filtering. If a package breaks...
Read more >
Building Objective-C static libraries with categories
QA1490: describes how to properly build Objective-C static ... Scroll down to the Other Linker Flags build setting under the Linking ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found