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

Prod Build fails when using signalr #559

Closed
peterdobson opened this issue Feb 14, 2018 · 4 comments
Closed

Prod Build fails when using signalr #559

peterdobson opened this issue Feb 14, 2018 · 4 comments

Comments

@peterdobson
Copy link
Contributor

peterdobson commented Feb 14, 2018

Similar to issue Prod build failed #460 , but when using signalr the prod build fails with:

ERROR in main-client.js from UglifyJs
Unexpected token: name (NullLogger) [main-client.js:84763,6]

After removing webpack.optimize.UglifyJsPlugin lines from webpack.config.js it publishes OK, but obviously files don't get minified.

There is a recent related fix in signalr, selfdeceited/bird-aggregator@ef13204 using uglifyjs-webpack-plugin instead of webpack.optimize.UglifyJsPlugin. I've tried this fix but it causes the build to fail with this template

Anyone have any pearls of wisdom?

@MaklaCof
Copy link

I had the same problem, and found this thread, but I am not sure what is the current state of a problem.

@peterdobson
Copy link
Contributor Author

peterdobson commented Feb 24, 2018

Found a workaround on aspnet/SignalR#983 which is working for me.

Need to replace:
import { HubConnection } from '@aspnet/signalr-client';
with:
import { HubConnection } from '@aspnet/signalr-client/dist/browser/signalr-clientES5-1.0.0-alpha2-final.min.js'

And I can now build for production with webpack.optimize.UglifyJsPlugin

@CybrZr00
Copy link

CybrZr00 commented Mar 4, 2018

For anyone using the newer version SignalR "@aspnet/signalr": "1.0.0-preview1-final" (At this time) the issue is supposed to be fixed!? but I found myself having to convert the ES6 signalr.js to ES5 using babel

@MarkPieszak
Copy link
Member

@CybrZr00 @peterdobson @MaklaCof
It sounds like @aspnet/signalr is packaging their bundles incorrectly and bundling them as es2015, they should transpile them down to es5.
Try opening an issue there, they shouldn't -only- be publishing es2015, that must be a mistake!

Changing one line in their tsconfig to es5 would fix it, strangely enough.

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

No branches or pull requests

4 participants