Skip to content

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

Open
@mririgoyen

Description

@mririgoyen

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions