On 17 September 2015 at 14:16, Dominic Bauer <bauerdominic@gmail.com> wrote:
> Hello everyone,
>
> I'm struggling with precompiling assets both on Heroku and locally when the
> environment is set to production.
It is worth, if you have not already done so, running the app and in
the browser check the javascript console to make sure it does not see
any problems.
Do you have any dynamic stuff in your javascript that might be picking
up from ENV with different results in different environments?
Colin
>
> I have a manifest file, ./app/assets/javascripts/application.js which
> includes another file, located at
> ./vendor/assets/javascripts/fullcalendar/dist/fullcalendar.js as follows:
>
> //= require fullcalendar/dist/fullcalendar
>
>
> This works just fine when I run a local server in development mode. I
> noticed something is off when I pushed to Heroku, which won't precompile my
> assets:
>
> remote: Running: rake assets:precompile
> remote: rake aborted!
> remote: Sprockets::FileNotFound: couldn't find file
> 'fullcalendar/dist/fullcalendar' with type 'application/javascript'
>
>
> So I tried precompiling assets locally, which works as expected when the
> environment is set to development. However, when I run …
>
> % RAILS_ENV=production bundle exec rake assets:precompile --trace
>
>
> … ExecJS yells at me (full trace here):
>
>
> ** Execute assets:precompile
> rake aborted!
> ExecJS::ProgramError: Unexpected token punc «(», expected punc «:» (line:
> 70927, col: 13, pos: 2134177)
>
>
> I have no idea what's wrong or how to debug this, because all of my own
> JavaScript gets tested, linted and passes just fine. My application doesn't
> throw errors in browsers either. I assume one of my dependencies uses ES6
> method definitions?
>
> Those are my asset paths:
>
> ./app/assets/images
> ./app/assets/javascripts
> ./app/assets/stylesheets
> ./vendor/assets/bower_components
> ./vendor/assets/javascripts
> ./vendor/assets/stylesheets
>
>
> And the only change I made in ./config/initializers/assets.rb is adding
> another manifest file for precompilation:
>
> Rails.application.config.assets.precompile += %w(onboarding.js)
>
>
> So to sum up my two questions:
>
> How do I properly include files located at /vendor/assets/**/* in manifest
> files?
> What's ExecJS executing at precompilation and how do I figure what breaks
> it?
>
>
> Thanks in advance!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/6ff46f89-a7c3-4953-901f-3ad36b3aa62f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtg2qkXqdpUpt2iMCzipRu%2BX9HtFM91ORHNHNaO4XrkBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment