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] Error with getStaticPaths in v2.0.1 #5975

Closed
1 task
juanmiguelguerrero opened this issue Jan 25, 2023 · 0 comments · Fixed by #5983
Closed
1 task

[prerender] Error with getStaticPaths in v2.0.1 #5975

juanmiguelguerrero opened this issue Jan 25, 2023 · 0 comments · Fixed by #5983
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@juanmiguelguerrero
Copy link
Contributor

juanmiguelguerrero commented Jan 25, 2023

What version of astro are you using?

2.0.1

Are you using an SSR adapter? If so, which one?

Netlify

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

Note: This only happens with "astro dev" command.

Templates with prerender active do not correctly handle routes that do not exist.

If we load any route that does not exist, if prerendering is true, it should handle the routes as static and return a 404.

But it seems that the template acts as a SSR type template, catch the route and returns an error because Astro.prop is empty (logical because there is no data for this route).

For example, when the browser asks for "/favicon.ico" throws an error...

Error test: https://stackblitz.com/github/juanmiguelguerrero/astro-prerender-starticpaths-v2.0.1-error

Link to Minimal Reproducible Example

https://stackblitz.com/github/juanmiguelguerrero/astro-prerender-starticpaths-v2.0.1-error

Participation

  • I am willing to submit a pull request for this issue.
@matthewp matthewp added prerender - P4: important Violate documented behavior or significantly impacts performance (priority) labels Jan 25, 2023
@natemoo-re natemoo-re self-assigned this Jan 25, 2023
natemoo-re added a commit that referenced this issue Jan 25, 2023
* fix(#5975): unmatched static paths should 404 during dev

* chore: add changeset

Co-authored-by: Nate Moore <[email protected]>
matthewp pushed a commit that referenced this issue Jan 26, 2023
* fix(#5975): unmatched static paths should 404 during dev

* chore: add changeset

Co-authored-by: Nate Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants