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

Angular Plugin es6 #482

Closed
driverpt opened this issue Feb 15, 2019 · 2 comments
Closed

Angular Plugin es6 #482

driverpt opened this issue Feb 15, 2019 · 2 comments
Labels
released This feature/bug fix has been released

Comments

@driverpt
Copy link

Bugsnag library is throwing an error when i configure TypeScript (via tsconfig) with es6 as target.

The error is somewhere in the index.js constructor stating that the you can only instantiate via the new keyword.

To replicate:

  • Create a Bugsnag Angular App
  • Set tsconfig.json target to ES6
@bengourley
Copy link
Contributor

bengourley commented Feb 19, 2019

I have confirmed that this is an issue.

It is because we compile the @bugsnag/plugin-angular module (which is authored in TS) to ES5-compatible JS, and there is limited interop between native classes and "classes" that are simluated with ES5 code.

Switching the tsconfig.json option "target": "es6" for our module makes this issue go away, but we'd need to explore the ramifications of that. It could potentially break people's projects – though maybe not as all Angular projects require a build step and are capable of consuming ES6 code?

@bengourley bengourley added the scheduled Work is starting on this feature/bug label Feb 19, 2019
bengourley added a commit that referenced this issue May 17, 2019
Polyfilled classes are not compatible with native classes so this updates
the plugin-angular build target to be ES6, meaning native classes are output.

Fixes #505 and #482.
@tomlongridge
Copy link
Contributor

Fixed in #540 and released in v6.3.0.

@abigailbramble abigailbramble added released This feature/bug fix has been released and removed scheduled Work is starting on this feature/bug labels Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

4 participants