Try deleting node_modules and run npm i and then npm run build
Vite manifest not found at
I'm trying to install vue3, inertia + tailwind css to a new project but it's not working.
I have this error
Vite manifest not found at: /home/vagrant/gps-system/public/build/manifest.json
I looked online and found that I was just supposed to npm install && npm run dev but when I try to run npm run dev I get this error
(node:10116) UnhandledPromiseRejectionWarning: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/vagrant/gps-system/node_modules/vite/dist/node/cli.js' imported from /home/vagrant/gps-system/node_modules/vite/bin/vite.js at new NodeError (internal/errors.js:322:7) at finalizeResolution (internal/modules/esm/resolve.js:308:11) at moduleResolve (internal/modules/esm/resolve.js:731:10) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11) at Loader.resolve (internal/modules/esm/loader.js:89:40) at Loader.getModuleJob (internal/modules/esm/loader.js:242:28) at Loader.import (internal/modules/esm/loader.js:177:28) at importModuleDynamically (internal/modules/esm/translators.js:114:35) at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14) at start (file:///home/vagrant/gps-system/node_modules/vite/bin/vite.js:44:3) (Use
node --trace-warnings ...to show where the warning was created) (node:10116) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:10116) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This is the setup
//composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"repositories": [
{ "type": "vcs", "url": "[email protected]:salcomsa/idp-conector.git" }
],
"require": {
"php": "^8.0.2",
"aacotroneo/laravel-saml2": "^2.1",
"guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^0.6.4",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7",
"salcomsa/idp-sdk": "dev-master"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"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
}
//package.json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.6.0",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"vite": "^3.0.0"
},
"dependencies": {
"@inertiajs/inertia": "^0.11.1",
"@inertiajs/inertia-vue3": "^0.6.0",
"@inertiajs/progress": "^0.2.7",
"@vitejs/plugin-vue": "^3.2.0",
"vue": "^3.2.36",
"vue-loader": "^17.0.0"
}
}
//vits.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [
vue({
base: null,
includeAbsolute: false,
}),
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
],
});
//app.blade.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
@inertiaHead
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body>
@inertia
</body>
</html>
//app.js
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/inertia-vue3'
import { InertiaProgress } from '@inertiajs/progress'
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
InertiaProgress.init()
createInertiaApp({
resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.mount(el)
},
});
What am I doing wrong?
Please or to participate in this conversation.