Skip to content

Import errors when using CSSBundling + 3rd Party Gem assets #73

@rapito

Description

@rapito

Given a rails application that uses a gem like rails-assets-jstree.
After trying to execute rails css:install:sass, I get a "Can't find stylesheet to import." error per each css asset that is inside a gem. I can perfectly follow the @import statement to the gem's asset.

Is there a necessary extra step to set cssbundling to be able to lookup inside included gems?

  • Command Executed: rails css:install:sass
  • Output:
Error: Can't find stylesheet to import.

29 │ @import 'jstree';
   │         ^^^^^^^^

  app/assets/stylesheets/application.sass.scss 29:9  root stylesheet
error Command failed with exit code 65.
  • application.sass.scss:
// something something
@import 'jstree';
// something more
  • Gemfile
source 'https://rails-assets.org' do
  gem 'rails-assets-jstree'
end
  • jstree gem structure
    image

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

    Issue actions