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

Armani's avatar
Level 17

Problem with vite and laravel ui

Today I installed a fresh Laravel app and then installed laravel/ui using this commands:

composer require laravel/ui
php artisan ui bootstrap
php artisan ui vue
php artisan ui bootstrap --auth

and inside vite.js I added this lines:

import vue from '@vitejs/plugin-vue';

,
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),       	

but when I want to npm install it gives me this error:

While resolving: undefined@undefined
Found: [email protected]
node_modules/vite
  dev vite@"^4.0.0" from the root project

Could not resolve dependency:
peer vite@"^3.0.0" from @vitejs/[email protected]
node_modules/@vitejs/plugin-vue
  dev @vitejs/plugin-vue@"^3.0.1" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
0 likes
8 replies
Armani's avatar
Level 17

@Sinnbeck

{
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@popperjs/core": "^2.11.6",
        "@vitejs/plugin-vue": "^3.0.1",
        "axios": "^1.1.2",
        "bootstrap": "^5.2.3",
        "laravel-vite-plugin": "^0.7.2",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "sass": "^1.56.1",
        "vite": "^4.0.0",
        "vue": "^3.2.37"
    }
}
1 like
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@Armani upgrade this to version 4

"@vitejs/plugin-vue": "^4.0.0", 
2 likes
Armani's avatar
Level 17

@sinnbeck Thank you very much but the package should do it automatically.

asherawelan's avatar

I raised a PR today to address this, and this has now been merged.

1 like

Please or to participate in this conversation.