Closed andrusch closed 2 months ago
Hi @andrusch
Can you take a look at this comment
Please let me know if it works for your case.
Bests, Minh
Hey @congminh1254
Yep, this resolved the issue. Apologies for not finding that ahead of opening this.
Best, Charlie
Description of the Issue
I've built a NextJS app and have included the Box SDK within some API routes. These routes work locally and also from a clean GitPod environment. When the NextJS route is deployed to Vercel, I receive the following error when trying to execute any of the API routes that include Box SDK.
Steps to Reproduce
export async function GET( req: NextRequest ) { try { const authClient = new BoxCcgAuth({ config: this._config }); const tokenResponse = await authClient.withUserSubject(BOX_USER_ID as string).retrieveToken() return NextResponse.json({ success: true }, { status: 200 }) } catch (e) { return NextResponse.json({ success: false }, { status: 400 }) } }
⨯ Error: Cannot find module 'proxy-agent' Require stack:
Versions Used
Typescript SDK: "box-typescript-sdk-gen": "^1.1.0" Platform: Vercel Node.js (if applicable): 20x "typescript": "^5.3.3"