-
Hi! I'm moving the application to the server, but I'm getting an error ENOENT: no such file or directory, open 'public/assets/.vite/manifest.json'. I don't understand what else this error could be related to. Has anyone encountered a similar situation? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
Hey! 👋🏻 Are you trying to deploy to production? |
Beta Was this translation helpful? Give feedback.
-
I cloned the entire project to the server and ran the build. But it didn't help; the same error occurred. |
Beta Was this translation helpful? Give feedback.
-
The following helped me: npx npm-check-updates -u |
Beta Was this translation helpful? Give feedback.
-
I'm encountering the same issue, I ran the commands above but that didn't help. The file seems to be in place and responds if accessed directly:
Also NODE_ENV is set to Production. The project was started from the API starter kit, but I later decided to add Vite, Inertia, Edge for the frontend, seems to all work well in my local but showing this error when deployed. Any ideas @RomainLanz @Sa1ch ? Thanks! |
Beta Was this translation helpful? Give feedback.
-
I had to update the Vite configuration on file import { defineConfig } from '@adonisjs/vite'
import app from '@adonisjs/core/services/app'
const viteBackendConfig = defineConfig({
/**
* The output of vite will be written inside this
* directory. The path should be relative from
* the application root.
*/
buildDirectory: 'public/assets',
/**
* The path to the manifest file generated by the
* "vite build" command.
*/
manifestFile: `${app.inProduction ? 'build/' : ''}public/assets/.vite/manifest.json`,
/**
* Feel free to change the value of the "assetsUrl" to
* point to a CDN in production.
*/
assetsUrl: '/assets',
scriptAttributes: {
defer: true,
},
})
export default viteBackendConfig The key is to tell the |
Beta Was this translation helpful? Give feedback.
-
I've tried both methods but it doesn't work @GradeyCullins @Sa1ch @RomainLanz |
Beta Was this translation helpful? Give feedback.
The following helped me:
npx npm-check-updates -u
npm install