Closed tddrmllr closed 9 years ago
I've tried adding application.html
and components/*
to the config.assets.precompile
array, but no luck. Any guidance @alchapone?
In which file do you have application.html file? @tikitikifoofoo
Which version of rails/polymer-rails are you using?
@alchapone I'm using 1.0.8
@rxever I just have this <%= html_import_tag 'application' %>
in my application layout template.
@alchapone using Rails 3.2.22 at the moment
@alchapone Having a problem precompiling my assets too.
rake aborted!
Sprockets::FileNotFound: couldn't find file '' with type 'text/html'
/Users/meisha/.rvm/gems/ruby-2.2.0@polymer-test/gems/sprockets-3.3.1/lib/sprockets/resolve.rb:64:in `resolve!'
/Users/meisha/.rvm/gems/ruby-2.2.0@polymer-test/gems/sprockets-3.3.1/lib/sprockets/context.rb:88:in `resolve'
/Users/meisha/.rvm/gems/ruby-2.2.0@polymer-test/gems/sprockets-3.3.1/lib/sprockets/legacy.rb:259:in `resolve_with_compat'
/Users/meisha/.rvm/gems/ruby-2.2.0@polymer-test/gems/sprockets-3.3.1/lib/sprockets/context.rb:142:in `require_asset'
/Users/meisha/.rvm/gems/ruby-2.2.0@polymer-test/gems/polymer-rails-1.1.0/lib/polymer-rails/processors/components_processor.rb:16:in `block in require_imports'
...
I believe this is related to <%= html_import_tag 'application' %>
@lvillasica Same problem
Sprockets::FileNotFound: couldn't find file '' with type 'text/html'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sprockets-3.3.3/lib/sprockets/resolve.rb:64:in `resolve!'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sprockets-3.3.3/lib/sprockets/context.rb:88:in `resolve'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sprockets-3.3.3/lib/sprockets/legacy.rb:259:in `resolve_with_compat'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sprockets-3.3.3/lib/sprockets/context.rb:142:in `require_asset'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/polymer-rails-1.1.0/lib/polymer-rails/processors/components_processor.rb:16:in `block in require_imports'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/lib/nokogiri/xml/node_set.rb:187:in `block in each'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/lib/nokogiri/xml/node_set.rb:186:in `upto'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2/lib/nokogiri/xml/node_set.rb:186:in `each'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/polymer-rails-1.1.0/lib/polymer-rails/processors/components_processor.rb:15:in `require_imports'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/polymer-rails-1.1.0/lib/polymer-rails/processors/components_processor.rb:8:in `process'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/polymer-rails-1.1.0/lib/polymer-rails/processors/components_processor_v3.rb:19:in `call'
/home/furima/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/polymer-rails-1.1.0/lib/polymer-rails/processors/components_processor_v3.rb:14:in `call'
It's weird, precompile works on my mac but not on my ubuntu server. I tried removing some require lines and it works. It's hard to figure out which dependency is causing the problem.
@lvillasica I was able to find out which component was causing the problem.
Use my fork to find out which file causes the error
gem 'polymer-rails', github: 'slek120/polymer-rails'
All I changed was
return components.blank? ? nil : components.first
to
return components.first unless components.blank?
raise StandardError, "Couldn't find file '#{file}' in '#{@context.pathname}'"
Could not reproduce this issue on my side. But if you guys can confirm that @slek120's fix solves the issue, I'd be glad to merge a PR.
@alchapone it doesn't fix the issue. it just reports which component is causing the error for precompile.
I found that some components have tests which have dependencies not included in the component's dependencies (eg iron-ajax has tests that require web-component-tester and test-fixture). I don't know why it was trying to compile the test though.
I fixed it by changing
Rails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'components', '**')
to
Rails.application.config.assets.paths << Rails.root.join('vendor', 'assets', 'components', '*')
So this error is from polymer-elements-rails
gem. I've already added test files to gitignore there, see v1.0.1
Getting the error below in production. How do I get rails to precompile that file?