Reputation: 1
I'm trying to deploy my project on Render, but I'm facing an issue during the build process, and I can't seem to figure out the root cause. Here's the error:
[vite:load-fallback] Could not load /opt/render/project/src/frontend/src/store/useAuthStore (imported by src/App.jsx): ENOENT: no such file or directory, open '/opt/render/project/src/frontend/src/store/useAuthStore'
at async open (node:internal/fs/promises:638:25)
at async Object.readFile (node:internal/fs/promises:1238:14)
at async Object.load (file:///opt/render/project/src/frontend/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:50719:25)
at async PluginDriver.hookFirstAndGetPlugin (file:///opt/render/project/src/frontend/node_modules/rollup/dist/es/shared/node-entry.js:20840:28)
at async file:///opt/render/project/src/frontend/node_modules/rollup/dist/es/shared/node-entry.js:19963:33
at async Queue.work (file:///opt/render/project/src/frontend/node_modules/rollup/dist/es/shared/node-entry.js:21050:32)
Checked for the file
Checked the src/store/ directory
, and the useAuthStore.js
file does exist.
The file is committed to GitHub and available in the repository.
Checked the import paths:
In my App.jsx
, I have this line:
import useAuthStore from './store/useAuthStore';
Since the file doesn't exist, I removed the import entirely, but Vite still seems to reference it during the build.
Cleaned the environment:
node_modules
, .vite
, and dist
folders.npm install
.npm run build—it
, works perfectly fine on my machine.Checked the Render environment:
.gitignore
issue.Ran npm audit fix:
Upvotes: 0
Views: 37