Skip to content

Hooks stopped working after upgrading #14747

@MattPhantastic

Description

@MattPhantastic

Describe the bug

After following these two issues:

  1. Cannot read properties of undefined (reading 'startsWith') vite-plugin-svelte#1053
  2. TypeScript nodes still causing code generation failures #14743

I've upgraded my Svelte version to the, as of current, latest 5.14.3. Hooks have completely stopped working for me. I can't even write a string to the console. My src/hooks.ts is essentially being ignored.

Reproduction

  1. Install new a new project with the latest version of SvelteKit
  2. Create a src/hooks.ts file:
import type { Handle } from "@sveltejs/kit";
export const handle: Handle = async ({ event, resolve }) => {
  console.log("Hooks?");
  const response = await resolve(event);
  return response;
};

Logs

No response

System Info

System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M2
  Memory: 120.38 MB / 8.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.18.0 - ~/Library/pnpm/node
  npm: 10.8.2 - ~/Library/pnpm/npm
  pnpm: 9.12.3 - ~/Library/pnpm/pnpm
Browsers:
  Brave Browser: 131.1.73.101
  Safari: 17.6
npmPackages:
  svelte: ^5.14.3 => 5.14.3 

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions