I've created a Laravel app, and then added Inertia and Vue using Laravel Breeze. Everything was running well until I writted this:
import { Inertia } from '@inertia/inertia'
In my AppName\\resources\\js\\Pages\\Dashboard.vue. Then, strangely, when I opened the browser in the dashboard I got this Vite error:
[plugin:vite:import-analysis] Failed to resolve import "@inertia/inertia" from "resources\js\Pages\Dashboard.vue". Does the file exist?
Here is my package.json:
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@inertiajs/vue3": "^1.0.0",
"@tailwindcss/forms": "^0.5.3",
"@vitejs/plugin-vue": "^4.0.0",
"autoprefixer": "^10.4.12",
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.19",
"postcss": "^8.4.18",
"tailwindcss": "^3.2.1",
"vite": "^4.0.0",
"vue": "^3.2.41"
},
"dependencies": {
"moment": "^2.29.4"
}
}
import { router } from '@inertiajs/vue3'.