Skip to content
Discussion options

You must be logged in to vote

If you use TypeScript, your editor will yell at you & ask you to mark the function GET to be async.

//  ./src/routes/api/tasks/+server.js
import { error } from '@sveltejs/kit';
import { PrismaClient } from '@prisma/client'

/** @type {import('./$types').RequestHandler} */
-export function GET({ url }) {
+export async function GET({ url }) {

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@magic-thomas
Comment options

Answer selected by magic-thomas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants