Closed AlexandreLemoine40 closed 5 months ago
Hey @AlexandreLemoine40! 👋🏻
Have you correctly set your NODE_ENV
variable to production
?
Hey @RomainLanz, Yes, as stated in the docs https://docs.adonisjs.com/guides/views-and-templates/inertia#why-my-production-build-is-not-working-
I'd really like to make it work as I'm a big fan of Adonis framework.
And btw there are other production build incoherences I'll raise issues for, concerning Lucid/Luxon imports builds
And btw there are other production build incoherences I'll raise issues for, concerning Lucid/Luxon imports builds
You probably updated your TypeScript
version to the latest release, which break some stuff. Please revert back as stated in our Discord and Twitter account.
https://x.com/adonisframework/status/1805309070833844475
Concerning your first issue, I would need a repository with the minimum amount of code to reproduce your issue.
Ok I'll downgrade TS and test again.
For the initial problem I just created my project using npm init adonisjs@latest my-project
, and chose Inertia, TS, React, and Session auth. Ran the migrations to my database, ran npm build, cd build, npm ci omit command, and npm start. That's all.
It's pretty sure that you don't have NODE_ENV to production
.
This message comes from the Vite dev server when it starts up. Which means you don't have NODE_ENV at production. Vite dev server shouldn't start in production.
my .env is in the build directory.
and still has the same effect
I've added the NODE_ENV before the node bin/server.js
and it is working now. Thanks
Needed to pass NODE_ENV=production in the node bin/server.js
command line as NODE_ENV=production node bin/server.js
Package version
@adonisjs/inertia@1.1.0
Describe the bug
Just basically created an Inertia project working perfectly in Dev mode but the production build is wrong, as it tries to find /inertia/..... in the project but inertia folder is not in the production build.
I've also removed inertia folder from the exclude path in the tsconfig but didn't change the result
Reproduction repo
No response