Description
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)
ERROR in vendor.a480795b35d0d09f117a.bundle.js from UglifyJs
Unexpected token: name (HubConnection) [vendor.a480795b35d0d09f117a.bundle.js:15675,6]
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)