camelaissani / rollup-plugin-closure-compiler-js

Rollup plugin for optimizing JavaScript with google-closure-compiler-js.
MIT License
31 stars 5 forks source link

Why it is expecting a semi colon? #10

Open binarykitchen opened 7 years ago

binarykitchen commented 7 years ago

When rolling up with your plugin I see this error

└─( 2 ) ❱❱❱ yarn build                                                                      1 ⏎  +2502 19:27 ❰─┘
yarn build v0.24.6
$ npm run std --silent
$ rollup -c env/prod/rollup.config.js 
100% (748): src/wrappers/optionsWrapper.js⚠️   'default' is not exported by 'node_modules/buffer-es6/index.js'
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
commonjs-proxy:/home/michael-heuberger/code/videomail-client/node_modules/buffer-es6/index.js (1:137)
1: import * as index from "/home/michael-heuberger/code/videomail-client/node_modules/buffer-es6/index.js"; export default ( index && index['default'] ) || index;
                                                                                                                                            ^

Input_0:1 (JSC_PARSE_ERROR)
Parse error. Semi-colon expected
var videomail-client = (function () {
             ^
'use strict';

function createCommonjsModule(fn, module) {
    return module = { exports: {} }, fn(module, module.exports), module.exports;

🚨   (closure-compiler-js plugin) Error transforming bundle with 'closure-compiler-js' plugin: compilation error, 1 error

error Command failed with exit code 1.

To reproduce, git clone this branch https://github.com/binarykitchen/videomail-client/tree/feature/rollupjs and do yarn build

Any tips would be very much appreciated.

camelaissani commented 7 years ago

Well, I would say you cannot create a variable identifier containing - There https://mothereff.in/js-variables#videomail-client a tool to check if JavaScript variable name is valid

Moreover, the definition from MDN

binarykitchen commented 7 years ago

well, i do not have a variable identifier with that name in my branch: https://github.com/binarykitchen/videomail-client/search?utf8=%E2%9C%93&q=videomail-client&type=

only have this in some html files <script src="/videomail-client.js"></script> ... the resource is called videomail-client.js but that should not have an impact, doesn't it?

camelaissani commented 7 years ago

Okay videomail-client is the name of your module. Then I think that's a known issue in rollup https://github.com/rollup/rollup/issues/1345