0

Can you run rake assets:precompile and use commas in place of semi colons? I ask because i'm running into another issue where my production js asset statements are separated with commas but my staging is separated with semi colons. I was given this project and the old dev quit without any knowledge passed down.

The production code looks something like this but in the minified version (I used pretty print so it's easy to read):

...}
,
$(document).ready(ready),
$(document).on("page:load", ready),
function() {
    window.App || (window.App = {}),
    App.init = function() {
        return $(".classname").select2(),
        $("#search").on("keyup", function() {
            return searchTable($(this).val())
        }),
        $("#search-list").on("keyup", function() {
            return searchList($(this).val())
        }),
        $("#my_id").on("change", function() {
            return $(this).parent().submit()
        }),
        $("#preloader").delay(200).fadeOut()
    }
    ,
    $(document).on("page:change", function() {
        return App.init()
    }),
    $(window).on("load", function() {
        return $("#status").fadeOut(),
        $("#preloader").delay(200).fadeOut()
    })
}
.call(this),
...

UPDATE: staging environment is running uglifier (4.1.18) and production is running uglifier (3.0.0). Could that be the difference?

Chris
  • 4,643
  • 6
  • 31
  • 49
  • The hunch based on your update might be correct. ps. lock down your Gemfile gem versions. – Josh Brody Aug 24 '18 at 20:31
  • Ya I'm using the lock file but they are different from production. I may just have to manually copy and paste the lock file from production to staging and redo bundle install. My hunch is that when I ran bundle install it just updated to the latest version because I don't have uglifier set to 3.0.0 ... i have it set to `gem 'uglifier', '>= 1.3.0'` – Chris Aug 24 '18 at 20:50
  • try using latest, `gem 'uglifier', '4.1.18'` — I can see that latest supports sequences, which I believe is the problem you're having. – Josh Brody Aug 24 '18 at 21:11
  • I was using that version. My production is using 3.0.0. I just updated my gemfile to use ~> 3.0.0 and bundle installed. I then clobbered my assets and precompiled and the same issue is happening. – Chris Aug 24 '18 at 21:13
  • can you make a reproducible dummy app and throw it on github? – Josh Brody Aug 24 '18 at 21:21

0 Answers0