-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build with --no-prerender flag is broken #970
Comments
Update: It seems it's a regression bug. With [email protected] works as it should be. |
i am seeing something very similar. Running a local debug server all is fine, but in my production builds some attributes are missing. For example my anchors are missing class names and the href in prod. Other bits of the app are fine, and i can see in the source that it should be setting the classes and href. Example is the Nav bar on my site https://codegolf.club This is also present in RC.9 package |
@tadejstanic i have pulled down your branch, and it looks similar to my problem. Here's the markup of your nav bar: But here's the source to the John element:
The issue is more than just CSS, but it's a bit beyond me |
@luhis The Navbar component on your website is not imported in any of the router components, right? What I’ve found out is that only the router components and all of their children (descendant) components are rendered correctly. They have all of their correct attributes. But components that are not imported/used in any of the route components (or their children), like the header component, which is imported directly in the App.tsx in Tadej’s example, are missing their attributes. |
@Kokanm you are correct. The nav bar is loaded in the base page, so it is outside any of the routes. |
This change, introduced in #957 is whats causing the problem it seems. Reverting it fixes the issues. |
Can you upgrade @preact/async-component? |
@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. |
thats a nice catch.. mind sending the PR? |
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.
preact build --no-prerender
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(R) Core(TM) 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
The text was updated successfully, but these errors were encountered: