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

Inaccurate route collision error #11957

Closed
1 task
delucis opened this issue Sep 9, 2024 · 3 comments · Fixed by #12028 or #12043
Closed
1 task

Inaccurate route collision error #11957

delucis opened this issue Sep 9, 2024 · 3 comments · Fixed by #12028 or #12043
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) needs triage Issue needs to be triaged

Comments

@delucis
Copy link
Member

delucis commented Sep 9, 2024

Astro Info

Astro                    v4.15.4
Node                     v18.20.3
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             test

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

n/a

Describe the Bug

In an Astro project with:

  • More than one injected routes
  • At least one injected route with a spread pattern (e.g. [...slug])
  • No index.astro or index.ts in src/pages/

Requests for / trigger a PrerenderDynamicEndpointPathCollide error even when there are no collisions.

What's the expected result?

When there are no collisions, a collision error should not be raised.


Details about the reproduction:

  • The inline integration in astro.config.mjs injects two routes
  • One is available at /page the other at /test — these both load successfully
  • Requesting / triggers the error (should be a 404)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-dm88gb?file=entrypoint-page.ts,entrypoint-test.ts,astro.config.mjs

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 9, 2024
@matthewp
Copy link
Contributor

is the problem that it always expects an index route to exist and is sending that as a param?

@matthewp matthewp added needs response Issue needs response from OP and removed needs triage Issue needs to be triaged labels Sep 16, 2024
@delucis
Copy link
Member Author

delucis commented Sep 16, 2024

is the problem that it always expects an index route to exist and is sending that as a param?

The problem is that Astro throws a “conflict” error even when there is no conflict, i.e.

  • [...slug] should handle /
  • page should handle /page

But Astro errors saying these two routes conflict for /.

@bluwy bluwy added - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs response Issue needs response from OP labels Sep 19, 2024
@bluwy bluwy self-assigned this Sep 19, 2024
@delucis
Copy link
Member Author

delucis commented Sep 20, 2024

Sharing an updated repro for this error being thrown by the Node adapter even with the fixed version: https://stackblitz.com/edit/github-dm88gb-pd8nv5?file=astro.config.mjs,entrypoint-test.ts,entrypoint-page.astro

Chatting on Discord with @bluwy about this and will decide whether we reopen or if I should make a new issue.

@bluwy bluwy reopened this Sep 20, 2024
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) needs triage Issue needs to be triaged
Projects
None yet
3 participants