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

frontend-toolkit - gem dependency/packaging issue #33

Closed
lostie opened this issue May 1, 2018 · 2 comments
Closed

frontend-toolkit - gem dependency/packaging issue #33

lostie opened this issue May 1, 2018 · 2 comments

Comments

@lostie
Copy link

lostie commented May 1, 2018

The following file that is included in the bundled gem call the following:

../../../govuk_elements/packages/govuk-elements-sass/public/sass/_govuk-elements.scss

but when the bundled file _govuk-elements.scss executes the following:

// bundled _govuk-elements.scss
// Import GOV.UK front end toolkit dependencies
@import "frontend-toolkit";

It can't successfully load it, as neither this gem includes it, neither the govuk_frontend_toolkit_gem.

For context, I've noticed this while setting the following in my main scss file for my Rails app:

// application.css.scss
@import "govuk-elements";

The actual error I got was the following:

Sass::SyntaxError - File to import not found or unreadable: frontend-toolkit.
Load paths:
<rails_app_root>/app/assets/images
<rails_app_root>/app/assets/javascripts
<rails_app_root>/app/assets/stylesheets
<rails_app_root>/lib/assets/data
<rails_app_root>/vendor/assets/images
<rails_app_root>/vendor/assets/javascripts
<rails_app_root>/vendor/assets/stylesheets
<ruby-gems-path>//.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jquery-rails-4.3.1/vendor/assets/javascripts
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_elements_rails-3.1.2/vendor/assets/stylesheets
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_frontend_toolkit-7.4.2/app/assets/docs
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_frontend_toolkit-7.4.2/app/assets/images
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_frontend_toolkit-7.4.2/app/assets/javascripts
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_frontend_toolkit-7.4.2/app/assets/spec
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_frontend_toolkit-7.4.2/app/assets/stylesheets
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_template-0.23.1/app/assets/images
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_template-0.23.1/app/assets/javascripts
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/govuk_template-0.23.1/app/assets/stylesheets
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/gov_uk_date_fields-2.1.1/vendor/assets/javascripts
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/gov_uk_date_fields-2.1.1/vendor/assets/stylesheets
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actioncable-5.0.7/lib/assets/compiled
<rails_app_root>/vendor/assets/images
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/susy-2.2.14/sass
<ruby-gems-path>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/susy-2.2.14/sass:

Would it be possible to add the frontend-toolkit file to its gem so it can be loaded correctly? (I've noticed that in dev mode the gem seems to work as the source code has a git submodule linked to the actual govuk_elements source code where the frontend-toolkit file does exist.

@36degrees
Copy link
Contributor

Hi Sergio,

Thanks for raising this. I've been able to reproduce this – it looks like that failing include is actually trying to import this file from Elements.

However, if you include the component parts of Frontend Toolkit and Elements as per the example in the readme it should work fine – with one exception:

@import 'elements/forms/form-block-labels'
@import 'elements/forms/form-date'
@import 'elements/forms/form-validation'

should be

@import 'elements/forms/form-date';
@import 'elements/forms/form-multiple-choice';
@import 'elements/forms/form-validation';

I'll raise a PR to update those docs now, and that should work fine for you. In the meantime, I'll try and dig in and work out why @import govuk-elements doesn't work.

@36degrees
Copy link
Contributor

I'm closing this as I believe it was addressed by #34.

benlovell added a commit to guidance-guarantee-programme/govuk_elements_rails that referenced this issue Mar 13, 2020
These files should have been symlinked when
alphagov#35 was merged but they were missed.

Also related to alphagov#33
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

2 participants