mizzao / meteor-sharejs

Meteor smart package for transparently adding ShareJS editors to an app
MIT License
225 stars 53 forks source link

Need to declare use of ecmascript #86

Closed edemaine closed 6 years ago

edemaine commented 7 years ago

Using mizzao:sharejs version 0.10.1 and 0.10.2 (tested on Meteor 1.4.2.7, 1.4.3.1, 1.4.3.2, and Meteor 1.4.3.3), I'm getting the following error message during meteor build (as part of mup deploy):

packages/minifyStdJS_plugin.js:113:28: UglifyJS minification error:

SyntaxError: Unexpected token: name (WebSocket) at
node_modules/meteor/mizzao_sharejs/node_modules/ws/lib/WebSocket.js line 31

within packages/mizzao_sharejs.js (line: 48752, col: 6, pos: 6273762):

class WebSocket extends EventEmitter {

at maybeThrowMinifyErrorBySourceFile (packages/minifyStdJS_plugin.js:113:28)
at packages/minifyStdJS_plugin.js:145:9
at Array.forEach (native)
at UglifyJSMinifier.processFilesForBundle
(packages/minifyStdJS_plugin.js:130:9)

=> Build Error. Check the logs printed above.
(node:13156) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: build-error

As far as I understand the situation as described in this issue, package mizzao:sharejs should api.use('ecmascript') because it (indirectly) depends on the ws (WebSocket) NPM package which needs to be transpiled from ES6 to ES4 before uglify.

By contrast, mizzao:sharejs version 0.9.0 works fine.

timolehto commented 7 years ago

Having this same issue, pinning to version 0.9.0 solved the issue.

ksopyla commented 7 years ago

I have also the same issue, unfortunately I can't use 0.9.0 version due to other dependencies. Can anyone have other solution? For now I switch to "debug mode" on production server but it is not best solution :(

edemaine commented 6 years ago

Not sure what happened, but (a) api.use('ecmascript') is already in the code, and (b) version 0.10.2 is working now on the latest Meteor.