I have a next.js application defined within my nx
powered repository. Locally, in order to build and start this service I can run: npx nx build web
and then npx nx start web
, and I’ll see that the second command does not rebuild the application, and correctly reads it from the build cache.
When I deploy to render, I see the build complete successfully and upload, but when the deployment goes to run npx nx start web
, it can’t seem to find the cache, and triggers a rebuild, which predictably exhausts the memory of the machine that it’s being deployed to.
I have tried disabling all of the nx
cloud magic by applying combinations of the NX_NO_CLOUD
environment variable and the --prod
and --skipRemoteCache
flags on the build/start commands, all to no avail, it never seems to use the cache when starting the service.
Any guidance here?