Vite runs on development but fails on production #389
-
Description 📖Hi, hoping you're having a good day. I've setup vite-rails for my application. Everything runs okay in development, however, when pushing the app to production. The build fails and i get this error,
I have read everywhere on the documentation but could not solve this. Anything would really help. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi Ahmed!
Please provide a trace of how the build fails. In most deployment configurations, if the build step fails, the deployment would be aborted.
Based on the error message, it looks like If the build actually run and failed, the error message would explicitly mention Verify that |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you for your fast response! Much needed! We're using a Dockerfile that runs
The pods are deployed but never started because of the error above. Sorry, i did not understand your question.
I've been looking into it and there's a
|
Beta Was this translation helpful? Give feedback.
-
I ran the |
Beta Was this translation helpful? Give feedback.
-
Thanks for this note! Indeed, we were not running the command in production mode. |
Beta Was this translation helpful? Give feedback.
Verify that
RAILS_ENV
isproduction
when precompiling assets for the Docker image.Vite Ruby will not create
public/vite-dev
if you are building for production.