Version 2.8.0 may require ES6 syntax
DennisWormald opened this issue · 2 comments
Just in case anyone else is having issues with this new update, I had to update my javascript compressor settings to get version 2.8.0 to work. The issue was that Uglifier was not set to allow ES6 syntax.
I changed my config/environments/production.rb from
config.assets.js_compressor = :uglifier
to
config.assets.js_compressor = Uglifier.new(harmony: true)
This has fixed the execjs 2.8.0 issues I was having (failing to precompile and having json parser error).
Update - found a new way to fix my issue with execjs not precompiling properly, and it also fixes my issues I was having with uglifier. I had to pin this older update in popper_js that happened 18 days ago, back to the previous version, then all my other issues dissappeared.
gem 'popper_js', '= 1.16.0'
Unsure why this all happened hope it helps someone.
Please see the FAQ:
Why can't I use ES5 features?
Some runtimes like Node will implement many of the latest ES5 features. However older stock runtimes like JSC on OSX and JScript on Windows may not. You should only count on ES3 features being available. Prefer feature checking these APIs rather than hard coding support for specific runtimes.