Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Angular 4 / SignalR angular-cli production build fails #765

Closed
maartenmensink opened this issue Aug 25, 2017 · 4 comments
Closed

Angular 4 / SignalR angular-cli production build fails #765

maartenmensink opened this issue Aug 25, 2017 · 4 comments

Comments

@maartenmensink
Copy link

When trying to incoperate a SignalR hub in to a angular 4 project i encounter a issue when creating a production build with angular-cli.

Repo to reproduce issue: https://github.com/maartenmensink/signal-core-test-prod-build

Steps:

  • npm install
  • ng build --prod --sm --verbose

Should give error:

ERROR in vendor.b0045e4649a2b76539df.bundle.js from UglifyJs
Unexpected token: name (Subject) [C:/projects/test/signal-core-test-prod-build/node_modules/@aspnet/signalr-client/dist/src/Observable.js:3,0][vendor.b0045e4649a2b76539df.bundle.js:17107,6]
@Tragetaschen
Copy link
Contributor

angular-cli uses UglifyJs and the latter doesn't support ES6 which this repository requires. There are already two issues for that in this repository.

@moozzyk
Copy link
Contributor

moozzyk commented Aug 25, 2017

I have not tried it yet but here is a possible workaround: #729 (comment) (as well as the entire thread about SignalR client and angular-cli).

@sniffer327
Copy link

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.
Now i'm using import { HubConnection } from '@aspnet/signalr-client' without errors while production building.

Angular-cli releases link: https://github.com/angular/angular-cli/releases

@moozzyk
Copy link
Contributor

moozzyk commented Nov 2, 2017

@SergBozhko - thanks for the update!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants