-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Probable issue with uglify, causing signalr-client to fail to build in production #7532
Comments
We don't overall support building for an es6/es2015 target, but that is being tracked in #2907. I'm beginning to think that we need to update Bear in mind that such a change does not ensure output ES5 compatiblity - if you import a library that needs some es2015 support it will break at runtime if it's not available. |
See webpack-contrib/uglifyjs-webpack-plugin#63 and https://github.com/mishoo/UglifyJS2/tree/harmony for more information about this. Fix angular#7532
See webpack-contrib/uglifyjs-webpack-plugin#63 and https://github.com/mishoo/UglifyJS2/tree/harmony for more information about this. Fix angular#7532
For anyone that want to use the signalr-client npm package with angular-cli:
In my signalR service I added two declarations: this one for in development: |
Fixed via #7610 |
hey @filipesilva Thanks |
@yosigolan did you set your tsconfig to use |
thanks @filipesilva, i thought it is not required, i dont want to reduce the legacy support. Yosi |
Angular-cli has updated 1.5.0. It's solved this problem. Current version of @aspnet/signalr-client: '1.0.0-alpha2-final' in my project. Angular-cli releases link: https://github.com/angular/angular-cli/releases |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Refer to
aspnet/SignalR#729
aspnet/SignalR#765
for the issue I raised with the signalr-client team.
I have created a sample repo at https://github.com/williamBurgeson/signalr-client_angular-cli
Quite simply, download the above repo and run ng build --prod, and you will get the error. Note the signalr-client is not hosted in the usual place in npm (I use yarn, but the principles are the same; it is hosted at https://dotnet.myget.org/f/aspnetcore-ci-dev/npm/).
Failing that, run the steps I described in the first comment from that thread:
aspnet/SignalR#729 (comment)
They have fixed the main problem, which was that when I included the current (at the time) version of signalr-client, it errored out when running ng build. Now that is fixed, but it still errors when running ng build --prod
If you see the last comments on that issue, they have implied the only way to fix this is to run ng eject (see aspnet/SignalR#729 (comment)) due to uglify not supporting ES6.
Is there anything which can be done from your end to mitigate this error, without having to ng eject? e.g. switch out dependencies or dependency versions etc. I'm not an expert on uglify by any means but would there be an option to use a newer version which does support ES6? (I assume the angular stack all still compiles down to ES5 to keep uglify happy if what they are saying is correct)
The text was updated successfully, but these errors were encountered: