Closed ogzhanolguncu closed 1 month ago
Looks like this does cause existing imports to be broken. Followed the Nextjs quickstart and got this after step 5.
Package path ./dist/nextjs is not exported from package
Also getting this type error
Argument of type '(request: Request) => Promise<Response>' is not assignable to parameter of type '((request: Request) => VerifySignatureAppRouterResponse) | ((request: NextRequest) => VerifySignatureAppRouterResponse)'.
Type '(request: Request) => Promise<Response>' is not assignable to type '(request: Request) => VerifySignatureAppRouterResponse'.
Type 'Promise<Response>' is not assignable to type 'VerifySignatureAppRouterResponse'.
Type 'Promise<Response>' is not assignable to type 'Promise<NextResponse<unknown>>'.
Type 'Response' is missing the following properties from type 'NextResponse<unknown>': cookies, [INTERNALS]
for
import { verifySignatureAppRouter } from "@upstash/qstash/nextjs";
async function handler(request: Request) {
const data = await request.json();
for (let i = 0; i < 10; i++) {
await fetch('https://firstqstashmessage.requestcatcher.com/test', {
method: 'POST',
body: JSON.stringify(data),
headers: { 'Content-Type': 'application/json' }
});
await new Promise(resolve => setTimeout(resolve, 500));
}
return Response.json({ success: true });
}
export const POST = verifySignatureAppRouter(handler);
Looks like this does cause existing imports to be broken. Followed the Nextjs quickstart and got this after step 5.
Package path ./dist/nextjs is not exported from package
Also getting this type error
Argument of type '(request: Request) => Promise<Response>' is not assignable to parameter of type '((request: Request) => VerifySignatureAppRouterResponse) | ((request: NextRequest) => VerifySignatureAppRouterResponse)'. Type '(request: Request) => Promise<Response>' is not assignable to type '(request: Request) => VerifySignatureAppRouterResponse'. Type 'Promise<Response>' is not assignable to type 'VerifySignatureAppRouterResponse'. Type 'Promise<Response>' is not assignable to type 'Promise<NextResponse<unknown>>'. Type 'Response' is missing the following properties from type 'NextResponse<unknown>': cookies, [INTERNALS]
for
import { verifySignatureAppRouter } from "@upstash/qstash/nextjs"; async function handler(request: Request) { const data = await request.json(); for (let i = 0; i < 10; i++) { await fetch('https://firstqstashmessage.requestcatcher.com/test', { method: 'POST', body: JSON.stringify(data), headers: { 'Content-Type': 'application/json' } }); await new Promise(resolve => setTimeout(resolve, 500)); } return Response.json({ success: true }); } export const POST = verifySignatureAppRouter(handler);
Yeah, sadly this change is breaking existing imports. And, I'll check nextjs import and make sure it works like this: @upstash/qstash/nextj
@MeshanKhosla imports should be fixed now, if there is anything wrong ping me
This PR
/dist/nextjs
or/dist
. This might break existing import paths.