Skip to content

Wildcard asset notation no longer works? #45

Open
@Vernadsky

Description

@Vernadsky

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?

Activity

bdrazhzhov

bdrazhzhov commented on Jul 30, 2016

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

Vernadsky commented on Jul 30, 2016

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

mihai-dinculescu commented on Jul 30, 2016

@mihai-dinculescu
Contributor

Can you please try

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

Vernadsky commented on Jul 31, 2016

@Vernadsky
Author

Hi @mihai-dinculescu,

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

mihai-dinculescu

mihai-dinculescu commented on Jul 31, 2016

@mihai-dinculescu
Contributor

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

Vernadsky commented on Aug 1, 2016

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

yvbeek commented on Aug 7, 2016

@yvbeek

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

mihai-dinculescu

mihai-dinculescu commented on Aug 18, 2016

@mihai-dinculescu
Contributor

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

yvbeek

yvbeek commented on Aug 29, 2016

@yvbeek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yvbeek@bdrazhzhov@Vernadsky@mihai-dinculescu

        Issue actions

          Wildcard asset notation no longer works? · Issue #45 · typescript-ruby/typescript-rails