Skip to content

Current template does not work with @sveltejs/kit 1.0.0-next.477+ #6690

@fvsch

Description

@fvsch

Describe the bug

The project template at https://github.com/sveltejs/kit-template-default/

When breaking changes are shipped in SvelteKit that impact this template, it must be updated immediately or every user that creates a new project from this template will have a broken project on their hand. This is especially the case for StackBlitz, which uses https://sveltekit.new/ which redirects to https://stackblitz.com/fork/github/sveltejs/kit-template-default. For instance here's a bug report about this starter being broken: stackblitz/webcontainer-core#803

I tested locally and with the latest version of the template, here are the results with different SvelteKit versions:

@sveltejs/kit version Result of npm run dev
1.0.0-next.470 500 Cannot read properties of undefined (reading 'get')
1.0.0-next.471 500 Cannot read properties of undefined (reading 'get')
1.0.0-next.472 ok
1.0.0-next.474 ok
1.0.0-next.475 ok
1.0.0-next.476 ok
1.0.0-next.477 Error: Rename your server hook file from src/hooks.js to src/hooks.server.js
1.0.0-next.478 Error: Rename your server hook file from src/hooks.js to src/hooks.server.js
1.0.0-next.479 Error: Rename your server hook file from src/hooks.js to src/hooks.server.js

Reproduction

Reproductions will only work for the current @sveltejs/kit@next and current HEAD commit of the sveltejs/kit-template-default repo, of course.

Online:

  1. Visit https://stackblitz.com/fork/github/sveltejs/kit-template-default (Chrome-based browser or Firefox)
  2. Wait for dependency installation to finish and npm run dev to start.
  3. The preview frame should show an error.

Locally:

  1. Setup:
git clone [email protected]:sveltejs/kit-template-default.git
cd kit-template-default
npm install
npm run dev
  1. Open the development server page in a browser.

Logs

No response

System Info

System:
    OS: macOS 12.5.1
    CPU: (8) arm64 Apple M1
    Memory: 117.86 MB / 8.00 GB
    Shell: 3.5.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.17.0 - /opt/homebrew/opt/node@16/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.1 - /Volumes/Pieces/.npm/bin/npm
  Browsers:
    Chrome: 105.0.5195.102
    Firefox Nightly: 106.0a1
    Safari: 15.6.1
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.72
    @sveltejs/kit: 1.0.0-next.479 => 1.0.0-next.479
    svelte: ^3.46.0 => 3.50.1
    vite: ^3.1.0 => 3.1.0

Severity

blocking all usage of SvelteKit

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.pkg:create-svelte

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions