ngannotate-rails
ngannotate-rails copied to clipboard
Not working on heroku
I'm noticing that this works fine locally but on heroku I'm getting a failed to instantiate module due to unknown provider: e -- any ideas?
Q: was there any other info?
Dont know what's ailing, so likely need to debug with heroku.
Perhaps some needed gem is not installed in production? Check Gemfile. Also try running assets compile task locally using "RAILS_ENV=production bundle exec rake ..."
@aesnyder did you verify that you use the exact version of ngannotate-rails (and ng-annotate) on your local machine as well as heroku?
I'm closing this because I'm an idiot, everything is working now. Sorry!
Encountered the same problem, @aesnyder how did you resolve it?
@aesnyder @haihappen I'm getting this issue on heroku myself. If this is resolved, can you please explain what the issue was and how to fix it?
@aesnyder if you've some info regarding issue, I would love to have it mentioned in project README, since clearly there is something which is tripping over several people.
Alternatively: Anyone, do you've some failing sample test app what I could look into to investigate issue?
@kikonen My team actually gave up attempting to get this module to work and instead switched to turning the :mangle
option off in rails instead as a temporary solution.
When following the steps to test locally I was able to confirm that the rendered javascript was not being annotated at all by ngannotate-rails, but wasn't able to locate the source of the issue. Unfortunately the project in question is client related so I can't hand over the source, but I can fire up a new rails project later today for testing and make that available.
If there is some case which is not handled you should be in contact with maintainer of ngannotate itself. He might be interested to hear about the trouble.
KI 1.1.2015 19.20 kirjoitti "Nathan Cox" [email protected]:
@kikonen https://github.com/kikonen My team actually gave up attempting to get this module to work and instead switched to turning the :mangle option off in rails instead as a temporary solution.
When following the steps to test locally I was able to confirm that the rendered javascript was not being annotated at all by ngannotate-rails, but wasn't able to locate the source of the issue. Unfortunately the project in question is client related so I can't hand over the source, but I can fire up a new rails project later today for testing and make that available.
— Reply to this email directly or view it on GitHub https://github.com/kikonen/ngannotate-rails/issues/10#issuecomment-68492163 .
This may be related ttps://github.com/jasonm/ngmin-rails/issues/6
So I'm completely kicking myself for not having answered this, as I just spent another few hours on it today....
-Rails.application.config.assets.version = '1.0'
+Rails.application.config.assets.version = '1.1
When pushing to heroku its important to invalidate all of your assets.
TODO:
- need to add remark about this into README
(just re-opening so that I will remember to add note into README)
Addressed README via https://github.com/kikonen/ngannotate-rails/pull/23
Did someone find out what's happening with heroku?
Invalidate all assets is not always an option, since then all assets needs to be recompiled from scratch and it takes lot of time.
Also one have to remember to invalidate them by changing value of config.assets.version
and that's boring.
I haven't myself spend time to investigate Heroku, since I don't right now have suitable env in Heroku for trying it out. But I hear you, clearly some digging is needed.
To make asset versioning easier in the meantime you could set an ENV variable like (taken from thoughtbot's suspenders):
Rails.application.config.assets.version = (ENV["ASSETS_VERSION"] || "1.0")
We might be able to optionally use a random cache_key
in the Sprockets processor which will always invalidate the cache, I believe. It's sort of a hack, but it might work.
Not working on dokku either. Even after cleaning the cache and bumping the assets version.
Moved to https://github.com/kikonen/ngannotate-rails/issues/26
Maybe you can try using the dyno-metadata labs to use the SLUG_ID
or the SLUG_COMMIT
as the assets version. That way it will get invalidated only on real new releases. I haven't tried it yet though.
heroku labs:enable runtime-dyno-metadata -a <app name>
and set
Rails.application.config.assets.version = ENV['HEROKU_SLUG_ID']