In my Symfony 4 project, I try to add bootstrap as an import after
yarn add bootstrap --dev
As I follow documentation, I tried to import bootstrap as follows:
@import "~bootstrap/scss/bootstrap";
When I run yarn encore dev, it says module not found.
Than I tried this:
@import "../../node_modules/bootstrap/scss/bootstrap.scss";
The output is:
Syntax Error: ModuleNotFoundError: Module not found: Error: Can't resolve './alert' in 'C:\Users\tolga\GIT\artifex\node_modules\bootstrap\scss'
What am I missing? alert.scss is there but it cannot find module. What should I try?
It seems I somehow solved the problem. First of all the import directory is this:
@import "../../node_modules/bootstrap";
I don't know why tilde didn't work. Adding sass-loader didn't help.
Old subject but the solution is to change the extension of file app.css to app.scss.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With