sentry-javascript: typescript error: @sentry/serverless requires gcp dev denpendency even if you only use AWS lambda
Package + Version
-
@sentry/browser -
@sentry/node -
raven-js -
raven-node(raven for node) - other: @sentry/serverless
Version:
5.27.1
Description
I added @sentry/serverless to an existing lambda functions app and I got this error.
node_modules/@sentry/serverless/dist/gcpfunction/cloud_events.d.ts:1:68 - error TS2307: Cannot find module '@google-cloud/functions-framework/build/src/functions' or its corresponding type declarations.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 14
- Comments: 19
Commits related to this issue
- Wrap google cloud functions with a Proxy(). Firebase wrappers such as `onRequest`, `onCreate`, etc return callable handlers with some important additional data in properties which is being used by `f... — committed to marshall-lee/sentry-javascript by marshall-lee 4 years ago
- Wrap google cloud functions with a Proxy(). Firebase wrappers such as `onRequest`, `onCreate`, etc return callable handlers with some important additional data in properties which is being used by `f... — committed to marshall-lee/sentry-javascript by marshall-lee 4 years ago
- Wrap google cloud functions with a Proxy(). (#3035) * Wrap google cloud functions with a Proxy(). Firebase wrappers such as `onRequest`, `onCreate`, etc return callable handlers with some importa... — committed to getsentry/sentry-javascript by marshall-lee 4 years ago
Has this been released? I’m using v6.2.2 and getting similar error:
I’m using @sentry/serverless 6.18.2 and I’m still getting those errors. Why was this ticket closed? I’m using AWS as my cloud provider and I don’t need/want the GCP packages to be installed just to bypass this error.
WARNING in ./node_modules/@sentry/serverless/esm/google-cloud-grpc.js 18:30-51 Module not found: Error: Can’t resolve ‘google-gax’
WARNING in ./node_modules/@sentry/serverless/esm/google-cloud-http.js 18:33-64 Module not found: Error: Can’t resolve ‘@google-cloud/common’
@HazAT this issue should definitely still be open though. unless your docs are amended to include work arounds to not bring in the whole dependency chain.
@HazAT @kamilogorek I’m still facing this 2 years later, should this issue be reopen?
thanks for the fix! I see that it’s not released yet though. do you think we could release this soon?
yea it’s definitely still an issue. i imagine breaking dependency chain apart is quite a task without creating separate libs for each cloud provider 😉. you can place all of the libs typescript errors out for in the webpack externals array to get around the typescript issue. webpack will still throw warnings but everything seems to work as intended.
I’m also getting the same error. We use AWS and it’s not great to have to install packages for other providers to get @sentry/serverless to compile properly.