Dec 10, 2023
0
Level 1
Could not load /vercel/path0/vendor/tightenco/ziggy/dist/vue.es.js
Hello i am facing the issue trying to deploy my Laravel, Inertia, Vite, Vue app on vercel.
i have no error testing my app in my localhost, everything works...
Vercel insted print this error:
[vite:load-fallback] Could not load /vercel/path0/vendor/tightenco/ziggy/dist/vue.es.js (imported by resources/js/app.js): ENOENT: no such file or directory, open '/vercel/path0/vendor/tightenco/ziggy/dist/vue.es.js' error during build: Error: Could not load /vercel/path0/vendor/tightenco/ziggy/dist/vue.es.js (imported by resources/js/app.js): ENOENT: no such file or directory, open '/vercel/path0/vendor/tightenco/ziggy/dist/vue.es.js' Error: Command "npm run build" exited with 1
This is my vite.config.js file:
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import vue from "@vitejs/plugin-vue";
import path from "path";
export default defineConfig({
plugins: [
laravel({
input: ["resources/css/app.css", "resources/js/app.js"],
refresh: true,
}),
vue({
template: {
base: null,
includeAbsolute: false,
},
}),
],
resolve: {
alias: {
ziggy: path.resolve(
__dirname,
"vendor/tightenco/ziggy/dist/vue.es.js"
),
},
},
});
and this is my app.js file:
import { createApp, h } from "vue";
import { createInertiaApp } from "@inertiajs/vue3";
import MainLayout from "@/Layouts/Mainlayout.vue";
import { ZiggyVue } from "ziggy";
createInertiaApp({
progress: {
// The delay after which the progress bar will appear, in milliseconds...
delay: 250,
// The color of the progress bar...
color: "#29d",
// Whether to include the default NProgress styles...
includeCSS: true,
// Whether the NProgress spinner will be shown...
showSpinner: false,
},
resolve: (name) => {
const pages = import.meta.glob("./Pages/**/*.vue", { eager: true });
let page = pages[`./Pages/${name}.vue`];
page.default.layout = page.default.layout || MainLayout;
return page;
},
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.use(ZiggyVue)
.mount(el);
},
});
how can i fix with vercel?? Thank you
Please or to participate in this conversation.