Closed JoseMPena closed 6 years ago
Thank you for the bug report, we'll investigate.
It may be related to https://github.com/webpack-contrib/sass-loader/issues/403
@JoseMPena can you check which version of sass-loader
is installed? (see yarn.lock
)
@Spone
sass-loader@^6.0.6:
version "6.0.6"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-6.0.6.tgz#e9d5e6c1f155faa32a4b26d7a9b7107c225e40f9"
dependencies:
async "^2.1.5"
clone-deep "^0.3.0"
loader-utils "^1.0.1"
lodash.tail "^4.1.1"
pify "^3.0.0"
That is weird because it's supposed to be fixed with sass-loader
6.0.3
I'm not sure it an issue with Komponent.
Do you reproduce it without komponent
, only webpacker
and sass-loader
?
Hello @JoseMPena,
This issue is not related with Komponent. I made some investigation on it, seems using application.scss
pack is not the recommended way. The official Webpacker guide and issues related to that point are pretty confusing.
You have two possibilities:
app/javascript/packs/src/application.scss
stylesheet_pack_tag 'application'
in your templateimport "./src/application.scss";
in your app/javascript/packs/application.js
or
app/javascript/packs/application.css
stylesheet_pack_tag 'application'
in your templateI am closing this issue. Feel free to open an issue on Webpacker to be more explicit about that point.
I just found a workaround. Moving application.scss
from frontend/packs
somewhere else, say, frontend/support
and just require it in application.js
import "../support/application.scss";
And it all works like a charm :)
@florentferry I posted the previous comment before refreshing this page 😝
versions & Setup
pachages.json
Gemfile.lock
application.html.erb
frontent/packs/application.js
Steps to Reproduce:
A)
Expected: "Hello World" to be displayed in console Actual: No "Hello World" message even tho compilation finishes with no error.
B)
Expected: "Hello World" to be displayed in console Actual: Success!
Note
webpack-dev-server has to be restarted between changes to see the issue.