Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Regexp URLs broken #707

Closed
IlyaSemenov opened this issue May 21, 2019 · 3 comments
Closed

Regexp URLs broken #707

IlyaSemenov opened this issue May 21, 2019 · 3 comments
Labels

Comments

@IlyaSemenov
Copy link

Per https://sapper.svelte.dev/docs#Regexes_in_routes:

For example, src/routes/items/[id([0-9]+)].svelte would only match numeric IDs — /items/123 would match, but /items/xyz would not.

This is not true, /items/xyz still matches.

Steps to reproduce

  1. npx degit sveltejs/sapper-template#webpack my-app
  2. Create src/routes/[id([0-9]+)].svelte with <h1>hello</h1>
  3. Run yarn && yarn dev
  4. Open http://localhost:3000/xyz

Expected result

Error 404

Actual result

The page shows 'Hello'.

@jcollum
Copy link

jcollum commented Jun 8, 2019

$ tree src/routes/
src/routes/
├── _error.svelte
├── _layout.svelte
├── about.svelte
├── data
│   ├── [year([0-9]+)].svelte

Same here, going to http://localhost:3000/data/xyz renders the page instead of a 404.

@Conduitry
Copy link
Member

Fixed in 0.27.2, thanks!

@jcollum
Copy link

jcollum commented Jun 8, 2019

Confirmed, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants