Describe the bug
Trying to use type definitions of SapperRequest and SapperResponse but getting Cannot use namespace 'SapperRequest' as a type instead of types.
import type { SapperRequest, SapperResponse } from "@sapper/server";
export async function get(req: SapperRequest, res: SapperResponse) {
res.json({ hello: "world" });
}
Describe the bug Trying to use type definitions of
SapperRequest
andSapperResponse
but gettingCannot use namespace 'SapperRequest' as a type
instead of types.tsconfig.json
:src/node_modules/@sapper/index.d.ts
:Logs n/a
To Reproduce I think just start a blank Sapper repo, run Typescript setup and then create a route like above
Expected behavior Should show proper types
Stacktraces n/a
Information about your Sapper Installation:
Severity Not critical, just annoying; can't use Sapper types
Additional context Add any other context about the problem here.
May relate to https://github.com/sveltejs/sapper/issues/1583#issuecomment-789645761