Closed JanMalte closed 6 years ago
Can you please provide a minimal setup so I can reproduce it?
Also note, latest library versions are published with ES6 code, you might need to review your setup if you need to transpile to ES5 or lower
[2018-06-06 15:47:17] error
[2018-06-06 15:47:17]
[2018-06-06 15:47:17] /static/index.ff37ca.js from UglifyJs
[2018-06-06 15:47:17] SyntaxError: Unexpected token: name (Event) [./~/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:3,0]
[2018-06-06 15:47:17]
[2018-06-06 15:47:17]
[2018-06-06 15:47:17] webpack: bundle build is now finished.
same error
ES6 to ES5 should be done by THIS module (via rollup), rather than by the final app. This changed somehow from 3.2.2 to 4.0-rc.
I'm having the same problem. I don't understand "THIS module (via rollup)" above? Essentially it seems that the events.ts
file isn't properly processed by webpack babel-loader with es2015 presets. How should we work on packaging this with webpack?
Edit: its clear how this changed, the events.ts file
I'm even following: https://gist.github.com/nojaf/daf886031072b572bc9a and adding { test: /\.ts(x?)$/, loader: "babel-loader?presets[]=es2015!ts-loader" }
to module loaders (and adding .ts
to the extensions. And still getting errors running webpack for "Unexpected token". The error line is directly on the es6 export class ...
line.
Next release will target ES5. Thanks for reporting
Version 4.0.0-rc3 throws an SyntaxError if used with Webpack and UglifyJs:
Version 3.2.2 can be used without any errors