-
Notifications
You must be signed in to change notification settings - Fork 252
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 17 app can't run with bugsnag/plugin-angular and esbuild #2057
Comments
Hi @mivanyna I am currently unable to reproduce the behaviour you are seeing. In order for us to investigate this further, can you please provide some more details?
If possible, would you also be willing to share the full BugSnag configuration in your app (the entire As this is a public thread, you are also welcome to share these details with us directly by contacting us at support@bugsnag.com and opening a support ticket, referencing this issue: #2057 |
Hi @mclack, Maybe something to mention is in my
Can't share the project. I've found a workaround:
Please let me know if you need something else from me. |
Hi @mclack, have added the link to the project |
Hi, are there any updates? |
Hi, I have the same issue after upgrading to the angular 17 error is thrown: |
Hi @mclack do you need anything else from my side for this issue? |
Hi @mivanyna and @pumpernikiell Please accept our apologies for the delay in response here. We are investigating this now, and will post any updates or questions on this thread as soon as we have them. Thank you for your patience. |
No rush! We can live w/o good error logging :) |
Hi @mivanyna and @pumpernikiell Thanks for your continued patience while we've investigated this issue. We were unable to reproduce the error on our end, both using a separate Angular 17 app, and the app provided by @mivanyna. @mivanyna, is the code you've shared up to date, and are the dependencies exactly the same as you're currently using in your app? When we've tried to run the repro code, we got dependency conflicts between Angular 17 and several other dependencies. Could you please tell us more about how you've upgraded your app, and which version you used prior to Angular 17? @pumpernikiell could you also let us know which version of Angular you have upgraded from? Would you also be willing to share an app which reproduces this error, similar to the one here? |
Hi @mclack , I'm opening the provided link and it's still reproducing: There is an error logged in the console. |
Hi @mivanyna Thank you for the clarification. After looking into this a bit more, we've realised that this error does indeed appear when opening the app on StackBlitz. However, we initially downloaded the app and attempted to build/run this locally, and when doing this, we noticed different errors which were regarding dependency conflicts instead. Due to the above, we believe that this issue could be due to the dependency conflicts we have observed, and it's possible that the debugging mechanisms on StackBlitz are potentially hiding these conflicts.
|
Hi @mclack, This error appears only after the start of the app. |
Hi @mclack, This is what you need to do for the downloaded project:
Please let me know if there are any questions |
Hi @mivanyna Thank you for your patience here. We have been able to reproduce the error you were seeing, and have made the necessary changes on the StackBlitz project you provided in order to fix all the errors appearing in the console. The issue seems like it was down to using the old You are likely to run into some more errors after this. If so, this should be fixed by adding
Please try the recommendations above and let us know whether that solves the problem. |
it works, thanks |
Hi! |
Are you experiencing any other errors in your app? Can you also check whether any network requests are being made to BugSnag? If so, what are the status of these requests? E.g. 200 (Accepted), 408 (Request Timeout). Additionally, can you please check whether the requests are being made to https://notify.bugsnag.com/. If you're not doing this already, could you also please try sending a handled event to BugSnag and let us know the outcome of this. If you're not seeing any requests being made, could you please share some code snippets of how you have configured BugSnag in your app? As this is a public thread, please feel free to open a ticket with us directly by contacting support@bugsnag.com. |
I'm experiencing the same issue. FWIW: The issue appears to be caused by the following: The resolved module for import { ErrorHandler, Injectable } from '@angular/core';
import Bugsnag, { Client } from '@bugsnag/js';
// zones are optional, so we need to detect if they are being used
// see https://angular.io/guide/zone#noopzone
var isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;
var BugsnagErrorHandler = /** @class */ (function (_super) {
__extends(BugsnagErrorHandler, _super);
function BugsnagErrorHandler(client) {
var _this = _super.call(this) || this;
if (client) {
_this.bugsnagClient = client;
}
else {
_this.bugsnagClient = Bugsnag._client;
}
return _this;
}
BugsnagErrorHandler.prototype.handleError = function (error) {
var handledState = {
severity: 'error',
severityReason: { type: 'unhandledException' },
unhandled: true
};
var event = this.bugsnagClient.Event.create(error, true, handledState, 'angular error handler', 1);
if (error.ngDebugContext) {
event.addMetadata('angular', {
component: error.ngDebugContext.component,
context: error.ngDebugContext.context
});
}
this.bugsnagClient._notify(event);
ErrorHandler.prototype.handleError.call(this, error);
};
BugsnagErrorHandler = __decorate([
Injectable(),
__metadata("design:paramtypes", [Client])
], BugsnagErrorHandler);
return BugsnagErrorHandler;
}(ErrorHandler));
export { BugsnagErrorHandler }; This code literally imports I presume the issue can temporarily be circumvented by setting the On the side of the |
Thanks for highlighting that. We are looking into the |
Describe the bug
Angular app fails on start with error
Class constructor ErrorHandler cannot be invoked without 'new'
Steps to reproduce
In the module providers:
"builder": "@angular-devkit/build-angular:browser-esbuild",
in angular.jsonClass constructor ErrorHandler cannot be invoked without 'new'
Btw, it works great with the
"builder": "@angular-devkit/build-angular:browser",
Environment
Example Repo
https://stackblitz.com/edit/angular-ivy-7x7fkm?file=src%2Fapp%2Fapp.module.ts
Example code snippet
Error messages:
The text was updated successfully, but these errors were encountered: