Skip to content
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

@sentry/browser/esm throw SyntaxError at iOS 9 Safari #1988

Closed
4 tasks done
issaTan opened this issue Apr 3, 2019 · 3 comments
Closed
4 tasks done

@sentry/browser/esm throw SyntaxError at iOS 9 Safari #1988

issaTan opened this issue Apr 3, 2019 · 3 comments

Comments

@issaTan
Copy link

issaTan commented Apr 3, 2019

Package + Version

  • @sentry/browser

Version:

5.0.3

Description

I'm using it for a vue project, when I set the configuration like the guide such as

import Vue from 'vue'
import * as Sentry from '@sentry/browser'

Sentry.init({
  dsn: 'myDSN',
  integrations: [new Sentry.Integrations.Vue({ 
    Vue,
    attachProps: true
  })]
})

It throw an error at the console
SyntaxError: Unexpected use of reserved word 'let' in strict mode
just like the photo below:
image

When I use the vue-cli configuration transpileDependencies to transpile the whole @sentry bundle with Babel, it throw another error:
ReferenceError: Can't find variable: exports
image

How can I get a es5 version? Or I can only use raven-js, Cause I need to keep the browser compatibility?

@issaTan issaTan changed the title @sentry/browser/esm throw SyntaxError at iOS 9 @sentry/browser/esm throw SyntaxError at iOS 9 Safari Apr 3, 2019
@issaTan
Copy link
Author

issaTan commented Apr 3, 2019

I think my situation is the same to #1989

@HazAT
Copy link
Member

HazAT commented Apr 3, 2019

ref #1989 (comment)

@cromefire
Copy link
Contributor

That is what happens normally if you transpile the whole node_modules with babel. what happened here is that @sentry/util/is.js gets imported, but @sentry/util/esm/is.js should be.

@HazAT did you remove the rewrite script? That's the reason it's there

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

No branches or pull requests

3 participants