ngannotate-rails icon indicating copy to clipboard operation
ngannotate-rails copied to clipboard

Not working on heroku

Open aesnyder opened this issue 10 years ago • 18 comments

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?

aesnyder avatar Aug 12 '14 21:08 aesnyder

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 ..."

kikonen-fiksu avatar Aug 13 '14 06:08 kikonen-fiksu

@aesnyder did you verify that you use the exact version of ngannotate-rails (and ng-annotate) on your local machine as well as heroku?

olov avatar Aug 13 '14 06:08 olov

I'm closing this because I'm an idiot, everything is working now. Sorry!

aesnyder avatar Aug 13 '14 13:08 aesnyder

Encountered the same problem, @aesnyder how did you resolve it?

ream88 avatar Nov 21 '14 09:11 ream88

@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?

natecox avatar Dec 29 '14 22:12 natecox

@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 avatar Jan 01 '15 13:01 kikonen

@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.

natecox avatar Jan 01 '15 17:01 natecox

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 .

kikonen avatar Jan 02 '15 09:01 kikonen

This may be related ttps://github.com/jasonm/ngmin-rails/issues/6

kikonen-fiksu avatar Jan 03 '15 11:01 kikonen-fiksu

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.

aesnyder avatar Feb 18 '15 22:02 aesnyder

TODO:

  • need to add remark about this into README

(just re-opening so that I will remember to add note into README)

kikonen avatar May 12 '15 11:05 kikonen

Addressed README via https://github.com/kikonen/ngannotate-rails/pull/23

kikonen avatar Jun 03 '15 18:06 kikonen

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.

fabn avatar Jun 21 '15 17:06 fabn

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.

kikonen avatar Jun 21 '15 19:06 kikonen

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")

farneman avatar Aug 13 '15 15:08 farneman

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.

lunks avatar Sep 19 '15 20:09 lunks

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

ulitiy avatar Feb 10 '16 03:02 ulitiy

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']

blackjid avatar Jun 13 '16 21:06 blackjid