Hi @chintan
First of all, npm run dev gives better errors.. Second, it would help if you show how you import the files..
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey,
Following is my package.json
"devDependencies": {
"axios": "^0.15.2",
"bootstrap-sass": "^3.3.7",
"bulma": "^0.3.1",
"jquery": "^3.1.0",
"laravel-mix": "^0.5.16",
"lodash": "^4.16.2",
"vue": "^2.0.1"
}
Now when I do npm run watch I get the following error
│ │ │ └─┬ [email protected]
ERROR Failed to compile with 1 errors
error in ./~/bulma/bulma.sass
Module parse failed: /Users/Sites/api/node_modules/bulma/bulma.sass Unexpected character '@' (2:0)
You may need an appropriate loader to handle this file type.
| /*! bulma.io v0.3.1 | MIT License | github.com/jgthms/bulma */
| @charset "utf-8"
|
| @import "sass/utilities/_all"
@ ./resources/assets/js/app.js 17:0-26
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
Any idea what could be the reason for this error ?
Thanks
Like @Leuchte said Bulma is CSS not JS. You compile it to your app.css file, and use its classes to mockup a template, component, etc... So your setup should take the shape of following:
/* webpack.mix.js */
const { mix } = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
In your layout file you should have something similar to following:
<head>
<link rel="stylesheet" href="{{ mix('/css/app.css') }}">
</head>
<body>
<!-- page content -->
<script src="{{ mix('/js/app.js') }}"></script>
</body>
And SCSS! Moreover, if you need to change variables in Bulma place them above the @import, like so:
// app.scss
$body-background: whitesmoke;
@import './node_modules/bulma/bulma.sass';
Hope that helps.
Please or to participate in this conversation.