Bootstrap and webpack #41191
-
I am studying the bootstrap documentation, I am now in this part bootstrap and webpack. Long story short is that if I run npm start in my project folder in cmd and check http://localhost:8888/ in my browser I get this error This is the snapshot of my variables-dark.scss file see line 11 where the error is caught but the truth is the variable $primary is well defined in line 303 on my variables.scss file. This is the first 500 lines of my variables.scss file also check line 496 in this file
Sorry I can't put the whole code of my variables.scss file. I ask Copilot it says make sure you import the variables.scss file before you import the variables-dark.scss file but that is exactly what I did in my bootstrap.scss file see the snapshot below in line 6 the line 7 I have done everything right or at least I think so, but still get the error, it is so sad and so frustrating, help me fix this problem |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hello, |
Beta Was this translation helpful? Give feedback.
Based on your Bootstrap and Webpack Repository:
node_modules
so you have torm -rf node_modules
firstnpm i
to install the regular packagesstyles.scss
you need to@import "bootstrap/scss/bootstrap";
instead of using@use
npm run build
and render theindex.html
in your browser, it works wellWhen you run
npm run start
the deprecation warnings from Sass can appear in the browser. In that case, you'll need to check how to ignore/silent these warnings via webpack.