-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undocumented removal of default export in v8 #12013
Comments
Hey, thanks for writing in. So we never supported this (it is also not documented anywhere), and if that ever worked it was accidental, not on purpose. If you look into any of our documentation, you'll see that you have to use We are unlikely to add a default export (and we never had one! See: https://github.com/getsentry/sentry-javascript/blob/v7/packages/node/src/index.ts), so you'll have to change to the supported syntax (either using a namespace import or importing the methods you want directly). |
Disagree with this being closed and this change remaining undocumented. Whether it was documented as a valid way to use Sentry or not should not matter here... it worked before for all of v7 as far as I am aware (we have always imported it this way) and per Hyrum's Law, it will be something that folks as using (especially as it is the default way to import a package). I would ask that you document this as a breaking change in the migration guide if there is no intention to re-add a default export. |
I agree with Matt here, although it wasn't documented before I think some people will have naturally used it as a default import if they just see a code snippet in the documentation without the import block in view, in fact some IDEs will do this automatically for you. What's worse, and is surprising to me is that this isn't caught by TypeScript, the code builds fine but then errors at runtime with the error above. Not knowing much about the inner workings of TypeScript, is that a types issue here or perhaps just not supported by TypeScript? |
I think this comes from how TS handles certain things internally and does some compat thing. As we never really supported this, and I think depending on your TS config this never worked, but with some TS configs it seemed to kind of work for whatever reason. I agree though that it makes sense to call this out in the migration docs, I'll add a note on this! 👍 See: #12100 |
…rk (#12100) It was brought up #12013 that importing Sentry as a default import is not working anymore in v8. While this was never officially supported (and also not "removed" on purpose, it just seemed to have worked incidentally before), I do not really consider this a "breaking change", but, as pointed out in the issue, it is still helpful to point this out in the migration docs, for users who incidentally did this before. We should also add this to migration docs on docs.sentry.io.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.0.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
N/A
Steps to Reproduce
Expected Result
Default export continues to exist, or the change is documented as a breaking change in the vb8 migration guide.
Actual Result
Not documented as far as I can tell, and no longer a default export.
The text was updated successfully, but these errors were encountered: