Laravel Vue.js Heroku [vite:load-fallback] 无法加载(导入者)": ENOENT:没有这样的文件或目录,打开



我正试图在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)编译所有内容时,一切都很好,没有错误。是什么原因导致我的资源无法编译?

我已经解决了这个问题

问题是,在Github上,文件夹名称为/resources/js/components/...,本地为/resources/js/Components/...(大写)。我不知道这是怎么发生的,但已经修复了

相关内容

  • 没有找到相关文章

最新更新