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

v1.3 is written with ES6 and no longer compiles in a "standard" Rails 4 app #29

Open
svyatov opened this issue Nov 6, 2017 · 3 comments

Comments

@svyatov
Copy link

svyatov commented Nov 6, 2017

It's somewhat OK, but I think it's worth mentioning in changelog and readme files. I spent quite some time debugging it after gem update. The error wasn't that straightforward:

ExecJS::RuntimeError: SyntaxError: Unexpected token: name (PerformanceBar) (line: 358, col: 6, pos: 12943)

Error
    at new JS_Parse_Error (/tmp/execjs20171106-3876-1k89ds2js:3623:11948)
    at js_error (/tmp/execjs20171106-3876-1k89ds2js:3623:12167)
    at croak (/tmp/execjs20171106-3876-1k89ds2js:3623:22038)
    at token_error (/tmp/execjs20171106-3876-1k89ds2js:3623:22175)
    at unexpected (/tmp/execjs20171106-3876-1k89ds2js:3623:22263)
    at semicolon (/tmp/execjs20171106-3876-1k89ds2js:3623:22781)
    at simple_statement (/tmp/execjs20171106-3876-1k89ds2js:3623:25959)
    at /tmp/execjs20171106-3876-1k89ds2js:3623:23747
    at /tmp/execjs20171106-3876-1k89ds2js:3623:22954
    at /tmp/execjs20171106-3876-1k89ds2js:3624:3759
new JS_Parse_Error ((execjs):3623:11948)
js_error ((execjs):3623:12167)
croak ((execjs):3623:22038)
token_error ((execjs):3623:22175)
unexpected ((execjs):3623:22263)
semicolon ((execjs):3623:22781)
simple_statement ((execjs):3623:25959)

And just a suggestion: please reverse the order in your changelog files across all peek gems. A common practice suggests that versions should go in descending order. Then the most recent changes are always at the top which is much more convenient. Examples:
https://github.com/rails/webpacker/blob/master/CHANGELOG.md
https://github.com/rspec/rspec-core/blob/master/Changelog.md
https://github.com/thoughtbot/factory_bot_rails/blob/master/NEWS
https://github.com/mperham/sidekiq/blob/master/Changes.md
https://github.com/plataformatec/devise/blob/master/CHANGELOG.md

Anyway, thank you for peek, it's awesome and we use it everyday. Let me know if I can help with any of these issues I mentioned above.

@RigoOnRails
Copy link

Just had this error right now. Worked well in development but gave me an error as I was deploying. I wonder if there's any gem that could take care of this?

@tisba
Copy link

tisba commented Jan 16, 2018

@svyatov did you found a workaround, or did you just downgrade?

@CHTJonas
Copy link

For a standard Rails 5 app this can be remedied by editing config/environments/production.rb and replacing

config.assets.js_compressor = :uglifier

with

config.assets.js_compressor = Uglifier.new(harmony: true)

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

No branches or pull requests

4 participants