我正在尝试在heroku上部署我的Laravel Vue.js项目(带有Inertia.js)。
但当它执行vite build
时,它会给出以下错误:
-----> Build
Running build
> build
> vite build
vite v3.1.1 building for production...
transforming...
✓ 90 modules transformed.
[vite:load-fallback] Could not load /resources/js/Components/Modals/FormModal.vue (imported by resources/js/Pages/Admin/Classrooms/Modals/CreateClassroomModal.vue): ENOENT: no such file or directory, open '/resources/js/Components/Modals/FormModal.vue'
error during build:
Error: Could not load /resources/js/Components/Modals/FormModal.vue (imported by resources/js/Pages/Admin/Classrooms/Modals/CreateClassroomModal.vue): ENOENT: no such file or directory, open '/resources/js/Components/Modals/FormModal.vue'
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
我已经尝试将package.json
中的node.js版本设置为本地使用的版本(16.x),但仍然出现此错误。
在CreateClassroomModal.vue
文件中,导入如下所示:
import FormModal from "@/Components/Modals/FormModal.vue";
并且文件/resources/js/Components/Modals/FormModal.vue
确实存在于项目中。
当我尝试在本地编译所有内容时(使用npm run build
),所有内容都运行良好,没有错误。是什么导致了我的资源无法编译?
1条答案
按热度按时间0wi1tuuw1#
"我已经解决了这个问题"
问题是Github上的文件夹名是
/resources/js/components/...
,而本地是/resources/js/Components/...
(大写)。我不知道这是怎么发生的,但它已经修复了👍