Next.js Discord

Discord Forum

qstash with app router

Unanswered
Australian Freshwater Crocodile posted this in #help-forum
Open in Discord
Australian Freshwater CrocodileOP
I'm trying to use qstash with app router but I get error when compiling:
TypeError: Cannot set properties of undefined (setting 'SHA224')
    at <unknown> (C:\.next\server\app\api\subscription\cancel\route.js:43)     
    at 8537 (C:\.next\server\app\api\subscription\cancel\route.js:43:6130)     
    at t (C:\.next\server\edge-runtime-webpack.js:1:128)
    at 9275 (C:\.next\server\app\api\subscription\cancel\route.js:43:16865)    
    at t (C:\.next\server\edge-runtime-webpack.js:1:128)
    at 1146 (C:\.next\server\app\api\subscription\cancel\route.js:28:46496)    
    at t (C:\.next\server\edge-runtime-webpack.js:1:128)
    at <unknown> (C:\.next\server\app\api\subscription\cancel\route.js:43:22487)
    at r (C:\.next\server\edge-runtime-webpack.js:1:1723)
    at <unknown> (C:\.next\server\app\api\subscription\cancel\route.js:1:51)   

> Build error occurred
[Error: Failed to collect page data for /api/subscription/cancel] {
  type: 'Error'
}


the route looks like this:
import { verifySignatureAppRouter } from "@upstash/qstash/nextjs";

// ...

export const POST = verifySignatureAppRouter(async (req: NextRequest) => {
  // ...

  await qstash.schedules.delete();

  // ...

  return NextResponse.json({ success: true });
});


works normally when qstash is removed

0 Replies