Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard asset notation no longer works? #45

Open
Vernadsky opened this issue Jul 30, 2016 · 9 comments
Open

Wildcard asset notation no longer works? #45

Vernadsky opened this issue Jul 30, 2016 · 9 comments

Comments

@Vernadsky
Copy link

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.
Add Rails.application.config.assets.precompile += %w( dashboard.js ) to config/initializers/assets.rb and restart your server

It works if I specify dashboard.jsdirectly 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?

@bdrazhzhov
Copy link
Member

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
Copy link
Author

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
Copy link
Contributor

Can you please try

gem 'typescript-rails', github: 'mihai-dinculescu/typescript-rails'

@Vernadsky
Copy link
Author

Vernadsky commented Jul 31, 2016

Hi @mihai-dinculescu,

Unfortunately that version doesn't work either.
Thanks for looking into this guys.

@mihai-dinculescu
Copy link
Contributor

mihai-dinculescu commented 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:

Rails.application.config.assets.paths << Rails.root.join('angular')

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 that Rails.application.config.assets.precompile is able to load files outside the defined paths.

@Vernadsky
Copy link
Author

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
Copy link

yvbeek commented Aug 7, 2016

I'm having the same issue. Any idea guys?

@mihai-dinculescu
Copy link
Contributor

@Zyphrax and/or @Vernadsky, please provide replication steps, or even better, a test project.

@yvbeek
Copy link

yvbeek commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants