-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
rails 6 with webpacker error~ #554
Comments
Thanks for taking the time to report this issue. I'm sorry you're having problems. I'm afraid we haven't had a chance to test and adapt this gem to the Webpacker way of managing assets. We'd be happy to consider a pull request that works for users using the traditional Sprockets asset pipeline, and the Webpacker assets pipeline. |
+1 for getting this to work with webpacker. |
I'd also love for this feature to be added! Thanks |
Until this feature can be implemented, I've managed to get this gem to work with Rails 6 and Webpacker:
I don't believe this messed up the rest of the application's CSS, but I haven't had the chance to fully test it yet. Edit: Fixed typo in step one. |
addisonmartin: I believe you mean "extract_css," not "extra_css." However, I still get the error: SassError: File to import not found or unreadable: rails_bootstrap_forms. |
@addisonmartin 's trick worked for me. Yes @ThomasConnolly the option is extract_css, not extra_css. |
Here is what finally worked for me: I cleared the buildpacks after learning they were not in the correct order. Here are docs from Heroku: Verify that your buildpacks are set correctly and that Node comes before Ruby: $ heroku buildpacks
$ heroku buildpacks
I also stopped precompiling my assets and let Heroku do that. |
@addisonmartin Are you still adding the gem? Implied yes, and I don't see anything in the node_modules that suggest it's installed otherwise. |
What do you mean @MtnBiker? I did not open this issue, only posted a resolution to get the gem working with Rails 6. To answer your question, I am still using the gem, and there is nothing to install that would appear in node_modules (I think). |
@addisonmartin. Thanks. The node_modules was a (rather obtuse) reference to what bootstrap has installed using Yarn and I had just looked to se if anything that looked like it related to forms. |
The css is only a few lines, you can also just manually place in your webpacker scss/css also
|
I came across the same issues plus the problem of bootstrap dropdown no longer working. Taking the workaround was showing the same error message. I then added the scss/css manually to app/javascript/stylesheets/application.scss. And now it was working and the dropdown works too.
|
Unfortunately, it does not work:
I don't have a solution, but I understand that Webpacker cannot find this file. Because the file is out off scope of Webpacker. |
I'm not sure if it can be related to this problem but I had a similar error using rails 7 and esbuild and I fixed it by doing the following import adding file extension ".css" into the file "project/app/assets/stylesheets/application.scss":
|
ERROR in ./app/javascript/stylesheets/application.scss (./node_modules/css-loader/dist/cjs.js??ref--7-1!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./app/javascript/stylesheets/application.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
@import 'rails_bootstrap_forms';
^
File to import not found or unreadable: rails_bootstrap_forms.
in /home/wotogo/myapp/datamart/app/javascript/stylesheets/application.scss (line 2, column 1)
Error:
@import 'rails_bootstrap_forms';
^
File to import not found or unreadable: rails_bootstrap_forms.
in /home/wotogo/myapp/datamart/app/javascript/stylesheets/application.scss (line 2, column 1)
at options.error (/home/wotogo/myapp/datamart/node_modules/node-sass/lib/index.js:291:26)
The text was updated successfully, but these errors were encountered: