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

Including assets from node_modules fails #798

Open
cseelus opened this issue Feb 19, 2019 · 0 comments
Open

Including assets from node_modules fails #798

cseelus opened this issue Feb 19, 2019 · 0 comments

Comments

@cseelus
Copy link

cseelus commented Feb 19, 2019

I use a SASS file , lets call it pdf.css, which is configured via assets.rb to be precompiled:

Rails.application.config.assets.precompile += %w( pdf.css )

When uncommenting the Yarn node_modules folder in assets.rb

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

… and including files from node_modules into the pdf stylesheet, it gets compiled to CSS and can be included normally in any Rails template.

When I include the same pdf.css with a Wicked PDF template though, I get the following error, see also #680:

undefined method `start_with?' for nil:NilClass
[…]/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:113:in `split_subpath'
[…]/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:128:in `block in paths_split'
[…]/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:127:in `each'
[…]/gems/sprockets-3.7.2/lib/sprockets/path_utils.rb:127:in `paths_split'
[…]/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:96:in `resolve_relative_path'
[…]/gems/sprockets-3.7.2/lib/sprockets/resolve.rb:33:in `resolve'
[…]/gems/sprockets-3.7.2/lib/sprockets/legacy.rb:66:in `resolve_with_compat'
[…]/gems/sprockets-3.7.2/lib/sprockets/base.rb:64:in `find_asset'
[…]/gems/sprockets-3.7.2/lib/sprockets/environment.rb:30:in `find_asset'
[…]/gems/wicked_pdf-1.1.0/lib/wicked_pdf/wicked_pdf_helper/assets.rb:77:in `find_asset'
[…]/gems/wicked_pdf-1.1.0/lib/wicked_pdf/wicked_pdf_helper/assets.rb:70:in `asset_pathname'
[…]/gems/wicked_pdf-1.1.0/lib/wicked_pdf/wicked_pdf_helper/assets.rb:47:in `wicked_pdf_asset_path'
[…]/gems/wicked_pdf-1.1.0/lib/wicked_pdf/wicked_pdf_helper/assets.rb:25:in `block in wicked_pdf_stylesheet_link_tag'
[…]/gems/wicked_pdf-1.1.0/lib/wicked_pdf/wicked_pdf_helper/assets.rb:21:in `gsub'
[…]/gems/wicked_pdf-1.1.0/lib/wicked_pdf/wicked_pdf_helper/assets.rb:21:in `wicked_pdf_stylesheet_link_tag'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants