mattiaerre / oc-hub

This repository has been created as a central hub for all the OpenComponents built by Mattia Richetto.
10 stars 2 forks source link

error when trying to publish oc-feedback-form #2

Closed mattiaerre closed 7 years ago

mattiaerre commented 7 years ago

When I try to publish the oc-feedback-form component to https://pink-pineapple.herokuapp.com/ registry I get the following error:

➜  oc-hub git:(master) oc publish oc-feedback-form
Packaging -> /Users/mrichetto/projects/oc-hub/oc-feedback-form/_package
(node:9716) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Time: 626ms
    Asset     Size  Chunks             Chunk Names
server.js  2.78 kB       0  [emitted]  main

undefined:1542
    throw new JS_Parse_Error(message, filename, line, col, pos);
    ^
Error
    at new JS_Parse_Error (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1534:18)
    at js_error (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:1542:11)
    at croak (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2089:9)
    at token_error (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2097:9)
    at unexpected (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2103:9)
    at expr_atom (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2630:9)
    at maybe_unary (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2792:19)
    at expr_ops (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2827:24)
    at maybe_conditional (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2832:20)
    at maybe_assign (eval at <anonymous> (/Users/mrichetto/.nvm/versions/node/v6.9.5/lib/node_modules/oc/node_modules/uglify-js/tools/node.js:28:1), <anonymous>:2856:20)

not sure why; any idea @matteofigus?

matteofigus commented 7 years ago

Interesting! macOS? Cli version?

mattiaerre commented 7 years ago

@matteofigus

➜  oc-hub git:(master) ✗ oc --version
0.36.1

let me know if you like to do a quick google hangout

matteofigus commented 7 years ago

Ah! Got it! It is trying to uglify the JS in the static folder, but that's ES6, which is not supported by Uglify. I think we should open an issue in the main repo as this seems to me like a interesting new problem. Quick fix, add a minify:false flag in the package.json - proper fix would be to fix oc in such way the client-side js minification happens with babili instead of uglify /cc @nickbalestra

mattiaerre commented 7 years ago

@matteofigus thing is that I've been able to publish it w/ a previous version of the CLI; maybe something changed in the new version? I do agree with you re the fact that we shouldn't uglify the static folder(s). As a quick fix, I will try to babelify myself the JavaScript; it is also good from a browser compatibility POV. Not sure if the best solution would be using babel also at the public folder level or just exclude it from the publish process.

// cc @nickbalestra

mattiaerre commented 7 years ago

@matteofigus do you still want me to open an issue in the OC repo? Do you think this issue is still relevant?

matteofigus commented 7 years ago

Yes. Currently a component with ES6 on static js fails to publish and this is an issue.

nickbalestra commented 7 years ago

Done it -> https://github.com/opentable/oc/issues/409

mattiaerre commented 7 years ago

closing because of:

https://github.com/opentable/oc/issues/409

// cc @matteofigus @nickbalestra