Unable to Serve Nextjs App
Description:
You may see the following error when trying to serve a next application when using a custom server:
throw new Error('Could not find ${fileToRun}. Make sure your build succeeded.');
Cause
This occurs due to an issue in Nx vesion 16.4.0 which is currently used by default in ensono stacks.
Workaround
You need to create a workspace using a newer version of Nx where the issue has been resolved. The issue should be fixed in Nx version 16.5.1. You can specify the Nx Version to use by using the --nxVersion argument, eg:
npx @ensono-stacks/create-stacks-workspace@latest --nxVersion 16.5.1
It should be noted that stacks hasn’t been tested against Nx Versions higher than 16.4.0, so it is possible that unexpected issues could arise if using a later Nx Version.