Skip to content

fix(ember): Use correct import from @sentry/browser#3077

Merged
kamilogorek merged 1 commit intogetsentry:masterfrom
mydea:fn/ember-correct-import
Nov 26, 2020
Merged

fix(ember): Use correct import from @sentry/browser#3077
kamilogorek merged 1 commit intogetsentry:masterfrom
mydea:fn/ember-correct-import

Conversation

@mydea
Copy link
Copy Markdown
Member

@mydea mydea commented Nov 26, 2020

The current code import Sentry from '@sentry/browser'; seems to work but is not actually correct, as @sentry/browser has no default export. I noticed this when trying out using embroider to build our app, where it warned me about this.

@mydea mydea requested a review from kamilogorek as a code owner November 26, 2020 08:58
@kamilogorek kamilogorek merged commit 36eddb2 into getsentry:master Nov 26, 2020
@kamilogorek
Copy link
Copy Markdown
Contributor

Good catch, thanks!

@mydea mydea deleted the fn/ember-correct-import branch November 26, 2020 13:25
@krisdages
Copy link
Copy Markdown

krisdages commented Dec 5, 2020

@kamilogorek I ran into this same issue in my project today with both the browser and node packages.

Is it possible to make import Sentry from "@sentry/<browser|node> work?
If I edit index.js and add

exports.default = exports;

it seems to fix the issue. Not sure if there is any downside to doing this.

It's potentially a big problem to run into since an error calling ([undefined] Sentry).init() means the error itself doesn't get reported ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants