src/routes/index/index.svelte
Author: markotarnajCreated Aug 14, 2019Updated Oct 19, 2021
Labelsproposal
Description
According to documentation:
src/routes/about/index.svelteis treated the same assrc/routes/about.svelte
It is reasonable to assume that src/routes/index/index.svelte would be treated the same as src/routes/index.svelte. So I created the following structure:
routes
├── about
| ├── index.svelte
| └── components
├── contact
| ├── index.svelte
| └── components
├── index
| ├── index.svelte
| └── components
├── _error.svelte
└── _layout.sveltewhich results in a 404 on index. As a workaround I simply added an empty index.svelte file inside /routes, and that fixed everything:
routes
├── about
| ├── index.svelte
| └── components
├── contact
| ├── index.svelte
| └── components
├── index
| ├── index.svelte
| └── components
├── _error.svelte
├── _layout.svelte
└── index.svelteFor some reason it doesn't load the empty routes/index.svelte, but it loads the routes/index/index.svelte which seems counter-intuitive.
Logs
(index):1 Failed to load resource: the server responded with a status of 404 (Not Found)
Expected behavior
Treat src/routes/index/index.svelte same as src/routes/index.svelte.
Version info:
- Sapper 0.27.0
- Svelte 3.0.0
- Rollup
Source: sveltejs/sapper