Issue deploying Next.js 14 with server actions
I'm trying to deploy a project using the newly released next.js 14 from yesterday. I have everything working locally including dev and local production builds. The issue occurs during the build step on Railway where my build fails because of the Next.js error:
To use Server Actions, please enable the feature flag in your Next.js config. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#convention
However, in Next 14 this option was removed as sever actions are now "stable". In fact locally the build will fail if you leave that feature flag enabled. This leads me to believe that nixpacks is potentially overriding my package.json next.js version. Or maybe a version 13 is stuck in our cache. Can anyone help me out. Thanks!
5 Replies
Project ID:
d56d2d18-a224-4e42-89ad-f6d1f43b6b55
d56d2d18-a224-4e42-89ad-f6d1f43b6b55
I have confirmed that during the bun install step next 14 is listed so not sure why this would be happening
it's easy enough to disable nixpacks cacheing, set a service variable
NIXPACKS_NO_CACHE
to 1
FYI using that service variable didn't help. Only thing that seems to help is setting a cacheDirectories on my package.json. Very annoyingly though if I remove that section after a successful build the issue seems to return.
I know this is all caching behavior stuff, but something seems broken if I see Next.14 get downloaded and installed by bun in the logs, but then next 14 is not what runs...
NIXPACKS_NO_CACHE=1
isn't working - any ideas?