Description
Describe the bug
When creating a fresh new SvelteKit project, creating a new page under routes
and visiting that page's URL seems to redirect to the index page (index.svelte
).
Also...
- when creating another new page and linking to that page's URL...
or - visiting the index page after creating new pages...
...throws the following error:
500
components[nodes[i]] is not a function
TypeError: components[nodes[i]] is not a function
Although, restarting the dev server seems to fix the issue.
Experienced this on version 1.0.0-next.347
, but it seems that it also occurs from next.345
since downgrading to next.344
seems to make the issue not occur.
Also, creating a new page while the dev server isn't running seems to also resolve the issue.
Reproduction
npm init svelte app-name
cd app-name && npm i
npm run dev
- Create a new page under
routes
, sayabout.svelte
then save the file. - Visit
/about
in a browser. - Create another new page, say
asdf.svelte
- Visit
/asdf
- Visit
/
Logs
No response
System Info
System:
OS: Linux 5.6 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (4) x64 AMD Ryzen 3 2200G with Radeon Vega Graphics
Memory: 768.98 MB / 13.68 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.1 - /run/user/1000/fnm_multishells/66257_1654141561309/bin/node
Yarn: 1.22.17 - /run/user/1000/fnm_multishells/66257_1654141561309/bin/yarn
npm: 8.1.2 - /run/user/1000/fnm_multishells/66257_1654141561309/bin/npm
Browsers:
Firefox: 100.0.2
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.50
@sveltejs/kit: 1.0.0-next.344 => 1.0.0-next.344
svelte: ^3.44.0 => 3.48.0
Severity
annoyance
Additional Information
Here's a screen recording to help describe what's happening.
svelte-bug.mp4
Also upon checking Kit's source code, it seems that these lines might be relevant to the issue, since checking the diff in the latest commit in the tag of version next.345
, a modification was done in these lines.
packages/kit/src/runtime/client/client.js