ก่อนหน้านี้ติดปัญหาเรื่องการพัฒนาเว็บแอพลิเคชันด้วย Laravel และ Vuejs โดยใช้ Vite ควบคู่ในการพัฒนา Frontend ตอนรัน npm run dev ก็ดูเหมือนจะใช้งานได้ปกติ
แต่พอมาลอง build ดูปรากฏว่าตัว application คอย redirect ไปที่ path /build ตลอดเลย พอหาข้อมูล ไปๆ มาๆ ก็เจอว่าตอนที่เขียนเราใช้ router ของฝั่ง vuejs ซึ่งทำเป็น SPA
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
});
จากโค๊ดด้านบนนี่แหละที่ มึนอยู่หลาย ชั่วโมง แก้ง่ายๆ ที่สุด คือทำแบบนี้
const router = createRouter({
history: createWebHistory(),
});
เข้าใจว่า import.meta.env.BASE_URL ค่า default น่าจะเป็น /build ถ้าเอาออกจะช่วยแก้ไขปัญหาได้ แต่ยังไม่ได้ลองว่าถ้าเราไปกำหนด env ตัวนี้ขึ้นมาก็อาจจะช่วยแก้ไขปัญหาได้ด้วยหรือเปล่า?
VITE_BASE_URL="/"
ใครลองแล้วได้ผลมาคอมเม้นกันด้วยนะ วันนี้ไปก่อนละ

winbuzz keeps account access and platform guidance simple for users who want a smoother online betting experience. The winbuzz login section allows visitors to enter quickly and also check common topics like winbuzz apk download, winbuzz game, and app support. The site presents payment details in a plain and readable way, making deposits and withdrawals feel easier to manage. With its direct structure and user-friendly tone, winbuzz remains a practical choice for players searching for easy Cricket ID access.
ตอบลบMany sports and casino users prefer websites that present details in a clean and understandable format, and dafawin does that well. It brings together helpful guidance on login access, banking steps, and betting options so visitors can quickly find what they need. The content style feels direct and useful, especially for users who value easy support language. Alongside these updates, the site also shares Cricket ID information, making it easier for players to move from inquiry to active participation with confidence.
ตอบลบIf someone wants easy-to-follow betting support and casino access information, 1win is a useful place to begin. The website shares key details about deposits, withdrawals, and user access in a simple format that helps visitors move forward faster. It keeps the experience focused on practical needs rather than unnecessary complexity. Many users also come to review updated Cricket ID information, which plays an important role for those interested in sports betting and connected online gaming options.
ตอบลบ