Open
Description
I've just upgraded to the latest version of typescript-rails, and now I get the following error:
Sprockets::Rails::Helper::AssetNotPrecompiled at /
Asset was not declared to be precompiled in production.
AddRails.application.config.assets.precompile += %w( dashboard.js )
toconfig/initializers/assets.rb
and restart your server
It works if I specify dashboard.js
directly in assets.rb
(the file is actually dashboard.ts
).
But normally wildcards work fine:
Rails.application.config.assets.precompile += %w(lib/*.js *.js)
I've tried variations with .ts
instead of .js
.
Did one of the commits break wildcard support?
Activity
bdrazhzhov commentedon Jul 30, 2016
Hello @Vernadsky,
Could you check it with other versions of this gem and specify version which works well with your assets? Please specify versions which cannot process your assets correctly.
Vernadsky commentedon Jul 30, 2016
Hi @bdrazhzhov,
Version 0.6.2.2 works fine (I've tried that version by manually specifying the 'v0.6.2.2' tag in my gemfile), the problem was introduced in 0.6.2.3. I suspect commit 0965b68 breaks it.
mihai-dinculescu commentedon Jul 30, 2016
Can you please try
Vernadsky commentedon Jul 31, 2016
Hi @mihai-dinculescu,
Unfortunately that version doesn't work either.
Thanks for looking into this guys.
mihai-dinculescu commentedon Jul 31, 2016
Do you have a reason for not using the already included by default path
lib/assets/javascripts
?Alternatively you can try add your custom path like this:
I'm no expert in the asset pipeline but to my knowledge you put the custom paths in
Rails.application.config.assets.paths
. I do not think thatRails.application.config.assets.precompile
is able to load files outside the defined paths.Vernadsky commentedon Aug 1, 2016
I've moved the app/assets/javascripts/lib files lib/assets/javascripts, but that doesn't solve the issue. Wildcards still don't work (neither versions).
yvbeek commentedon Aug 7, 2016
I'm having the same issue. Any idea guys?
mihai-dinculescu commentedon Aug 18, 2016
@ZyphraX and/or @Vernadsky, please provide replication steps, or even better, a test project.
yvbeek commentedon Aug 29, 2016
I've noticed that this error only occurs when I use the .ts extension, it all works fine if I name my files .js.ts.