Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Page with At sign (@) at the beginning of the file name ignored by routes #2451

Closed
maxcoredev opened this issue Sep 17, 2021 · 2 comments
Closed

Comments

@maxcoredev
Copy link

maxcoredev commented Sep 17, 2021

Describe the bug

Hello everyone. In my project I want:

https://example.com/123 <- to be an article detail page
https://example.com/@123 <- to be a user detail page

And If i create two files:

  1. [id].svelte
  2. @[id].svelte

it does not work. It always goes with [id].svelte

However, this works as expected:

  1. [id].svelte
  2. u[id].svelte

Reproduction

1) Create two files:

  1. [id].svelte
  2. @[id].svelte

2) [id].svelte:

<script context="module">
    export const load = async ({page}) => {
        console.log(page.params.id) 
    };
</script>

3) Navigate browser to http://localhost:3000/@1
4) See output of console.log(page.params.id)
It'll be @1 instead of 1

System Info

System:
  OS: macOS 11.4
  CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Memory: 253.82 MB / 16.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 16.6.2 - /usr/local/bin/node
  Yarn: 1.22.11 - /usr/local/bin/yarn
  npm: 7.20.3 - /usr/local/bin/npm
Browsers:
  Chrome: 93.0.4577.82
  Safari: 14.1.1
npmPackages:
  svelte: ^3.34.0 => 3.42.6

Severity

annoyance

@bluwy
Copy link
Member

bluwy commented Sep 17, 2021

Note: The fix might be related to #2401, but looks like it's a different issue.

@benmccann
Copy link
Member

Looks like a duplicate of that issue to me. I just merged the fix

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants