Next.js SSR handler crash

Hi, our netlify project is failing when accessing a “second level” URL, this means that works fine, but fails, it does it for all the routes and it started without changes in our codebase, so I believe it might be related to SSR and how netlify serves the page.
The error that is displayed in thee browser is:

and the logs of SSR handler are:

Jun 26, 11:05:58 AM: 2023-06-26T14:05:58.230Z	undefined	ERROR	Uncaught Exception 	{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'react/jsx-runtime'\nRequire stack:\n- /var/task/.netlify/functions-internal/___netlify-handler/requireHooks.js\n- /var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js\n- /var/task/___netlify-handler.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module 'react/jsx-runtime'","Require stack:","- /var/task/.netlify/functions-internal/___netlify-handler/requireHooks.js","- /var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js","- /var/task/___netlify-handler.js","- /var/runtime/index.mjs","    at _loadUserApp (file:///var/runtime/index.mjs:997:17)","    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1032:21)","    at async start (file:///var/runtime/index.mjs:1195:23)","    at async file:///var/runtime/index.mjs:1201:1"]}Jun 26, 11:05:58 AM: Unknown application error occurred

Thu build is made with node v14.21.2 and npm v 6.11.3

I was able to fix this by updating node/npm versions to 16.19.0 and 8.19.3. Even though the NODE_VERSION and the NPM_VERSION env variables were set with the values mentioned before, I discovered that the functions are using a much higher version of node, I assume that was the problem.

In the environment variables setup of the building is possible to set up a version for functions, I think that is not working, otherwise, this issue would never have taken place.

thanks for sharing your solution with the community.