immobiliare/fastify-sentry

Mark Sentry dependencies with caret mark

fedorov-xyz opened this issue · 4 comments

Currently all Sentry deps of fastify-sentry have strict versions:

 "dependencies": {
    "@sentry/node": "7.59.2",
    "@sentry/tracing": "7.59.2",
    "@sentry/utils": "7.59.2",
  },

It means that if I need to install @sentry/node to my project separatly to use some functions from it, I have to sync versions. If I use versions with caret (^7.60.0), yarn installs all sentry deps in 2 places:

  • project/node_modules — my project
  • project/node_modules/@sentry/node/node_modules/ — that's a problem

That causes type errors:

image

If we look to yarn.lock file, we could find that all Sentry version have duplicates with no caret:

image

So, my suggestion is to prefix all versions with caret:

 "dependencies": {
    "@sentry/node": "^7.59.2",
    "@sentry/tracing": "^7.59.2",
    "@sentry/utils": "^7.59.2",
  },

Specifying strict resolution in package.json is a workaround

image

I could make a PR to do it, if that suggestion will be ok for you.

dnlup commented

Hi @fedorov-xyz , to give a little context on the reason behind pinning the exact version:

#316

On a non-breaking update of sentry we encountered breaking changes on some internals (not public, so understandable) functions we were using in this plugin. The team at sentry have done an amazing work to refactor the sdk api internals, so it might be not a great issue anymore. I am not against removing the pinned version and using the caret. Just out of curiosity, isn't viable for you to use the sdk instance exposed on the fastify instance (fastify.Sentry)?

dnlup commented

I could make a PR to do it, if that suggestion will be ok for you.

That would be nice, thank you

🎉 This issue has been resolved in version 6.0.10 🎉

The release is available on:

Your semantic-release bot 📦🚀