require('@grpc/grpc-js') returns undefined when using sentry configs on next-js app #6970
Closed
3 tasks done
Labels
Package: nextjs
Issues related to the Sentry Nextjs SDK
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.34.0
Framework Version
Next 12.0.4
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
I'm trying to import @grpc/grpc-js inside an API call. When I changed the next.config.js as I shared, require('@grpc/grpc-js') returns undefined.
Expected Result
Importing grpc package without problem
Actual Result
`
TypeError: Cannot read properties of undefined (reading 'loadPackageDefinition')
4 | const grpc = require('@grpc/grpc-js');
5 | const pkgDefs = importProto('proto/goquake.proto');
The text was updated successfully, but these errors were encountered: