Skip to content

request.params not available in handle hook as docs / types indicate #1194

@RaeesBhatti

Description

@RaeesBhatti

Describe the bug
Request.params is null in handle hook.

Logs

To Reproduce

  1. Create a route that uses params, e.g. src/routes/[product]/index.svelte
  2. Create a hook with handle function located at src/hooks.ts
  3. Try to access request.params in handle function

Example repo: https://github.com/RaeesBhatti/svelte-params-bug

Expected behavior
request.params should be available in handle function of hooks.

Stacktraces

Information about your SvelteKit Installation:

Diagnostics
  System:
    OS: macOS 11.2.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 535.77 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.8.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.7 - /usr/local/bin/npm
  Browsers:
    Chrome: 90.0.4430.85
    Safari: 14.0.3
    Safari Technology Preview: 14.2
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.87 
    svelte: ^3.29.0 => 3.37.0 
  • Your browser: Safari Version 14.0.3 (16610.4.3.1.7)

  • Your adapter: Cloudflare Worker but this issues comes up even in dev mode.

Severity
Blocking usage of SvelteKit because I need params to fetch the right data from database.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions