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

haritz's avatar

Breeze install error './bootstrap'

Hello,

I am trying to install Laravel Breeze but when I run de the command 'php artisan breeze:install --dark' I get this error:

Could not resolve './bootstrap' from resources/js/app.js
error during build:
Error: Could not resolve './bootstrap' from resources/js/app.js

Package.json

{
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@alpinejs/focus": "^3.10.3",
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.4",
        "alpinejs": "^3.4.2",
        "autoprefixer": "^10.4.2",
        "laravel-vite-plugin": "^0.7.0",
        "postcss": "^8.4.6",
        "tailwindcss": "^3.1.0",
        "vite": "^3.0.4"
    }
}

Composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "consoletvs/charts": "6.*",
        "filament/filament": "^2.0",
        "filament/forms": "^2.0",
        "filament/tables": "^2.0",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^9.19",
        "laravel/sanctum": "^3.0",
        "laravel/tinker": "^2.7",
        "laraveldaily/laravel-charts": "^0.1.29",
        "outhebox/blade-flags": "^1.1",
        "staudenmeir/eloquent-json-relations": "^1.1"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/breeze": "^1.16",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

If I remove or comment 'import './bootstrap';' from 'app.js' is added automatically when I try to install Breeze. App.js

import './bootstrap';

import Alpine from 'alpinejs';

window.Alpine = Alpine;

Alpine.start();
0 likes
6 replies
Sinnbeck's avatar

Do you have a file named bootstrap.js next to app.js?

haritz's avatar

@Sinnbeck No, inside of 'resources/js' I only have 'app.js' and inside 'resources/css' I only have 'app.css'

haritz's avatar

@Sinnbeck Now I get the next error:

[vite]: Rollup failed to resolve import "lodash" from "resources/js/bootstrap.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@haritz clean up the file from anything you don't need. If you don't need lodash, remove that line

1 like

Please or to participate in this conversation.