Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

09cody's avatar

Attempting to get Spark off the ground - "Unable to locate Mix file: /css/app.css."

Hello,

I've been trying to get Spark installed and off the ground for about twelve hours now. I've been met with nothing but errors at every turn, but thankfully I believe I'm through the worst of it. I now have the placeholder landing page displaying, but when I click "Log in" or "Register" I'm met with an exception that says "Unable to locate Mix file: /css/app.css. Please check your webpack.mix.js output paths and try again."

My webpack.mix.js file at the root of my Spark project folder:

let mix = require('laravel-mix');
var path = require('path');

mix.less('resources/assets/less/app.less', 'public/css')
   .copy('node_modules/sweetalert/dist/sweetalert.min.js', 'public/js/sweetalert.min.js')
   .copy('node_modules/sweetalert/dist/sweetalert.css', 'public/css/sweetalert.css')
   .js('resources/assets/js/app.js', 'public/js')
   .webpackConfig({
        resolve: {
            modules: [
                path.resolve(__dirname, 'vendor/laravel/spark/resources/assets/js'),
                'node_modules'
            ],
            alias: {
                'vue$': 'vue/dist/vue.js'
            }
        }
   });

Being my first foray into Laravel beyond a few simple tutorial applications, I preemptively apologize for my ignorance. I simply don't know what the site is looking for or what I need to change in this file. If anyone could shed some light on my (hopefully very simple) issue, or point me in the direction of some pertinent documentation, I thank you ahead of time. I've been attempting to research this issue for several hours now to no avail.

Also, and this may either be related or a separate issue all together, I'm still unable to perform a npm run dev without issue. I've solved everything except for a final "dependency was not found":

This dependency was not found:

  • bootstrap/dist/js/npm in ./vendor/laravel/spark/resources/assets/js/spark-bootstrap.js To install it, you can run: npm install --save bootstrap/dist/js/npm

When I run the command that is displays above, it tells me "Could not install from "bootstrap/dist/js/npm" as it does not contain a package.json file."

I'm unsure if these two issues are related, but they are currently the last two outstanding issues that I have.

0 likes
4 replies
Chris1904's avatar

I have never had any Spark projects but have you ran npm install?

09cody's avatar

About a thousand times throughout the day, ha.

Update: Looks like I got it. I scrapped that project and started a new one from scratch. It didn't work at first either, but I eventually got it. Thanks guys.

midnightcipher's avatar
This dependency was not found:

* bootstrap/dist/js/npm in ./spark/resources/assets/js/spark-bootstrap.js

Is the error I'm getting. Any idea how you fixed it?

tjefford's avatar

Spent a couple hours with this today, for me it was a conflict of bootstrap 3 and 4.

The fix, was to edit the spark-bootstrap file provided by a plain spark installation.

This assumes you are using bootstrap4 via npm installation.

Around line 42

spark/resources/assets/js/spark-bootstrap.js

Change this: require('bootstrap/dist/js/npm');

To this: require('bootstrap');

Please or to participate in this conversation.