Skip to content
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

SSR outputs <undefined></undefined> node #822

Closed
ciampo opened this issue Jul 1, 2019 · 7 comments
Closed

SSR outputs <undefined></undefined> node #822

ciampo opened this issue Jul 1, 2019 · 7 comments

Comments

@ciampo
Copy link

ciampo commented Jul 1, 2019

Do you want to request a feature or report a bug?
Bug

What is the current behaviour?

When enabling SSR, the output is a <undefined></undefined> node, instead of the contents of the page

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

  1. Follow this gist to use latest preact cli, and update preact dependencies to latest version: https://gist.github.com/developit/f1a3425ded9b52206c372b6c6b54ddcb

  2. Add a prerender-urls.json file in the root project folder and add this content:

[
  {
    "url": "/",
    "title": "Homepage"
  }
]
  1. run npm run build

  2. notice how the file build/index.html has a <undefined></undefined> HTML node instead of the SSRs page

What is the expected behaviour?

The SSR'd HTML file should include the page contents.

If this is a feature request, what is motivation or use case for changing the behaviour?

N/A

Please mention other relevant information.

  • Node version 12.3.1
  • npm version 6.9.0
  • Operating system MacOS 10.14.5
  • CLI version 3.0.0-rc.2
  • Browser N/A
@ForsakenHarmony
Copy link
Member

Do you have preact-compat installed? if so please remove it

@ciampo
Copy link
Author

ciampo commented Jul 1, 2019

Good catch, I did have it installed.

Although I removed preact-compat from package.json, re-installed dependencies, and I am still having the same problem.

Can you reproduce it too?

@evont
Copy link

evont commented Jul 3, 2019

maybe you should try upgrading preact-render-to-string to 5.02

@ForsakenHarmony
Copy link
Member

yeah I forgot about that part thanks @evont

We should make it more obvious though

/cc @developit

@ciampo
Copy link
Author

ciampo commented Jul 4, 2019

Thank you @evont, that fixed it!

@ForsakenHarmony Yeah it'd be a good idea to update the gist

@developit
Copy link
Member

Gist updated. Might be neat for us to add a check to the CLI that verifies known good versions.

@ForsakenHarmony ForsakenHarmony moved this from Needed to In progress in Preact-cli 3.0 Jul 12, 2019
@ForsakenHarmony ForsakenHarmony moved this from In progress to Done in Preact-cli 3.0 Jul 12, 2019
@ForsakenHarmony ForsakenHarmony added this to To do in 3.X via automation Jul 12, 2019
@reznord
Copy link
Member

reznord commented Mar 21, 2020

This is fixed in the latest versions of CLI.

@reznord reznord closed this as completed Mar 21, 2020
3.X automation moved this from To do to Done Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3.X
  
Done
Development

No branches or pull requests

5 participants