-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
Labels
invalid linkThe issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened.The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened.
Description
Bug Report
Description: @sendgrid/mail.setApiKey() throws TypeError: Cannot read properties of undefined (reading 'client') when called from Server Actions with Turbopack enabled.
Error:
TypeError: Cannot read properties of undefined (reading 'client')
Reproduction: https://github.com/kyeb/sendgrid-turbopack-repro
Minimal requirements to reproduce:
- Next.js 15.4.0-canary
- Turbopack enabled (--turbo)
- Server Actions ('use server')
- SendGrid's setApiKey() call
Working configurations:
- Regular API routes (even with Turbopack)
- Server Actions with webpack bundler
Failing configuration:
- Server Actions + Turbopack
Environment:
- Next.js: 15.4.0-canary.84
- @sendgrid/mail: ^8.1.5
- Node.js: v22.14.0
The issue appears to be specific to how Turbopack handles the SendGrid module's internal state in Server Actions context.
Metadata
Metadata
Assignees
Labels
invalid linkThe issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened.The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened.