Recently, I decided to upgrade my project from Bootstrap 4.5 to Bootstrap 5. The process involved overwriting the old bootstrap files with npm install bootstrap@next
. However, after making this transition, I encountered a problem where I could no longer use the bootstrap utilities. Despite importing them, they did not seem to be compiled into the stylesheet.
This is what my app.scss file looks like:
@import "variables";
@import "../node_modules/bootstrap/scss/functions";
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";
@import "../node_modules/bootstrap/scss/grid";
@import "../node_modules/bootstrap/scss/utilities";
For example, when attempting to hide an element using .d-none
, it had no effect. Even after checking the compiled stylesheet, the utility class was nowhere to be found.