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

Prerender Data Hook doesn't properly trigger errors on bad paths #1538

Open
mririgoyen opened this issue Feb 13, 2021 · 0 comments
Open

Prerender Data Hook doesn't properly trigger errors on bad paths #1538

mririgoyen opened this issue Feb 13, 2021 · 0 comments

Comments

@mririgoyen
Copy link

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

What is the current behaviour?

Using the prerender hook, if the URL it is trying to get the preact_prerender_data.json file does not exist, it does not properly report an error. This is because the function to get the data is asynchronous but the function is called and then immediately returned. See:

What is the expected behaviour?

The error value is reported as true via the hook interface.

Please mention other relevant information.

Environment Info:
  System:
    OS: macOS 11.2.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.4/bin/yarn
    npm: 7.5.2 - ~/.nvm/versions/node/v14.15.4/bin/npm
  Browsers:
    Chrome: 88.0.4324.150
    Edge: 88.0.705.68
    Firefox: 85.0
    Safari: 14.0.3
  npmPackages:
    preact: ^10.3.2 => 10.5.12
    preact-cli: ^3.0.0 => 3.0.5
    preact-render-to-string: ^5.1.4 => 5.1.12
    preact-router: ^3.2.1 => 3.2.1
  npmGlobalPackages:
    preact-cli: 3.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant