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

Visiting route /examples throws error without 404 on dev server #8613

Closed
1 task
BryceRussell opened this issue Sep 20, 2023 · 8 comments
Closed
1 task

Visiting route /examples throws error without 404 on dev server #8613

BryceRussell opened this issue Sep 20, 2023 · 8 comments
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@BryceRussell
Copy link
Member

BryceRussell commented Sep 20, 2023

Astro Info

Astro                    v3.1.1
Node                     v18.16.1
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When visiting the route /examples the dev server throws an error and does not 404

image

Other pages/routes render correctly or throw a 404 if they don't exist

What's the expected result?

For the dev server render the page like normal or show 404

Link to Minimal Reproducible Example

https://github.com/BryceRussell/astro-issue-collection-breaking-dev

The reproduction works on stackblitz but does not work locally (I am using Windows and pnpm)
https://stackblitz.com/github/BryceRussell/astro-issue-collection-breaking-dev

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 20, 2023
@matthewp
Copy link
Contributor

What do you mean by breaks the dev server? In the SB it does a 404, is that what you mean?

@matthewp
Copy link
Contributor

The reproduction has a misspelling, the file is named exmaples.md, so a 404 is expected here.

@BryceRussell
Copy link
Member Author

BryceRussell commented Sep 20, 2023

Oops, my bad! I fixed the file name, but the error is still occurring. It looks like this is working on stackblitz but locally (using Windows and pnpm) it throws the error in the screenshot above and does not 404

Repo: https://github.com/BryceRussell/astro-issue-collection-breaking-dev

Example of bugged /examples route:

image

image

Example of a page that shows 404:

image

Example of a working route:

image

@BryceRussell BryceRussell changed the title Content Collection route with file/slug named examples breaks dev server Visiting route /examples throws error without 404 Sep 20, 2023
@BryceRussell BryceRussell changed the title Visiting route /examples throws error without 404 Visiting route /examples throws error without 404 on dev server Sep 20, 2023
@BryceRussell
Copy link
Member Author

BryceRussell commented Sep 20, 2023

It looks like Content Collections has nothing to do with this, this is happening to the route /examples in general. Visiting /examples on the dev server with or without a page is causing the error.

@matthewp matthewp self-assigned this Sep 21, 2023
@matthewp matthewp added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed needs triage Issue needs to be triaged labels Sep 21, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Sep 21, 2023

Could not reproduce the issue.

image

Edit: I am running Node 20.7

@bluwy
Copy link
Member

bluwy commented Sep 22, 2023

This might be a Vite bug. Do you have C:\examples\package.json exists in your filesystem? I can't reproduce it locally either.

@BryceRussell
Copy link
Member Author

BryceRussell commented Sep 22, 2023

@bluwy I do, I guess at some point I accidentally created an Astro project at C:\examples

image

Confirmed that deleting this fixes the problem

@bluwy
Copy link
Member

bluwy commented Sep 22, 2023

Looks like you're hitting vitejs/vite#6859 so I don't think there's much that can be done in Astro. But it's good to know that it can be reproduced without needing the Astro project also in the root in the first place in contrary to that issue. I'll close this for now!

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2023
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

No branches or pull requests

4 participants