Having trouble running NextJS webservice on render

Hi I am getting this following error when I am node application (nextjs). I set env with a latest Node version.

Oct 30 02:35:20 PM  ==> Cloning from https://github.com/product2023/slack_cleaner_1...
Oct 30 02:35:21 PM  ==> Checking out commit f4f733bd6d52ae66cf9583072d966808a0ba1070 in branch main
Oct 30 02:35:24 PM  ==> Downloading cache...
Oct 30 02:35:46 PM  ==> Using Node version 18.0.0 via environment variable NODE_VERSION
Oct 30 02:35:46 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Oct 30 02:35:48 PM  ==> Running build command 'npm cache clean --force; npm install; npm i --save @fortawesome/fontawesome-svg-core'...
Oct 30 02:35:52 PM  
Oct 30 02:35:52 PM  added 1 package, and audited 367 packages in 2s
Oct 30 02:35:52 PM  
Oct 30 02:35:52 PM  120 packages are looking for funding
Oct 30 02:35:52 PM    run `npm fund` for details
Oct 30 02:35:52 PM  
Oct 30 02:35:52 PM  found 0 vulnerabilities
Oct 30 02:35:54 PM  
Oct 30 02:35:54 PM  up to date, audited 367 packages in 1s
Oct 30 02:35:54 PM  
Oct 30 02:35:54 PM  120 packages are looking for funding
Oct 30 02:35:54 PM    run `npm fund` for details
Oct 30 02:35:54 PM  
Oct 30 02:35:54 PM  found 0 vulnerabilities
Oct 30 02:35:44 PM  ==> Transferred 174MB in 9s. Extraction took 8s.
Oct 30 02:35:55 PM  ==> Uploading build...
Oct 30 02:36:12 PM  ==> Deploying...
Oct 30 02:36:09 PM  ==> Build uploaded in 11s
Oct 30 02:36:09 PM  ==> Build successful 🎉
Oct 30 02:36:54 PM  ==> Using Node version 18.0.0 via environment variable NODE_VERSION
Oct 30 02:36:54 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Oct 30 02:36:54 PM  ==> Running 'npm run dev'
Oct 30 02:36:59 PM  
Oct 30 02:36:59 PM  > my-text-cleaner@0.1.0 dev
Oct 30 02:36:59 PM  > next dev
Oct 30 02:36:59 PM  
Oct 30 02:37:00 PM   ⚠ You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env
Oct 30 02:37:13 PM  Your service is live 🎉
Oct 30 02:37:10 PM  (node:61) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
Oct 30 02:37:10 PM  (Use `node --trace-warnings ...` to show where the warning was created)
Oct 30 02:37:22 PM   ⚠ Found lockfile missing swc dependencies, run next locally to automatically patch
Oct 30 02:37:25 PM    ▲ Next.js 13.5.6
Oct 30 02:37:25 PM    - Local:        http://localhost:10000
Oct 30 02:37:25 PM    - Environments: .env
Oct 30 02:37:25 PM  
Oct 30 02:37:25 PM   ✓ Ready in 14.6s
Oct 30 02:37:28 PM   ○ Compiling / ...
Oct 30 02:38:31 PM   ✓ Compiled / in 65.2s (259 modules)
Oct 30 02:38:36 PM   ✓ Compiled in 5.9s (259 modules)
Oct 30 02:38:39 PM  TypeError: (0 , react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV) is not a function
Oct 30 02:38:39 PM      at App (webpack-internal:///./pages/_app.js:12:87)
Oct 30 02:38:39 PM      at Wc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:39 PM      at $c (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
Oct 30 02:38:39 PM      at bd (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:39 PM      at $c (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
Oct 30 02:38:39 PM      at bd (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:74:209)
Oct 30 02:38:39 PM  TypeError: (0 , react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV) is not a function
Oct 30 02:38:39 PM      at App (webpack-internal:///./pages/_app.js:12:87)
Oct 30 02:38:39 PM      at Wc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:39 PM      at $c (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
Oct 30 02:38:39 PM      at bd (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:39 PM      at $c (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
Oct 30 02:38:39 PM      at bd (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Oct 30 02:38:39 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:39 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:74:209)
Oct 30 02:38:40 PM   ⨯ pages/_app.js (5:10) @ Component
Oct 30 02:38:40 PM   ⨯ TypeError: (0 , react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV) is not a function
Oct 30 02:38:40 PM      at App (webpack-internal:///./pages/_app.js:12:87)
Oct 30 02:38:40 PM      at Wc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
Oct 30 02:38:40 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
Oct 30 02:38:40 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:40 PM      at $c (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
Oct 30 02:38:40 PM      at bd (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
Oct 30 02:38:40 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
Oct 30 02:38:40 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Oct 30 02:38:40 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:40 PM      at $c (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
Oct 30 02:38:40 PM      at bd (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
Oct 30 02:38:40 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217)
Oct 30 02:38:40 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Oct 30 02:38:40 PM      at Z (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
Oct 30 02:38:40 PM      at Zc (/opt/render/project/src/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:74:209) {
Oct 30 02:38:40 PM    page: '/'
Oct 30 02:38:40 PM  }
Oct 30 02:38:40 PM    3 | 
Oct 30 02:38:40 PM    4 | export default function App({ Component, pageProps }) {
Oct 30 02:38:40 PM  > 5 |   return <Component {...pageProps} />
Oct 30 02:38:40 PM      |          ^
Oct 30 02:38:40 PM    6 | }
Oct 30 02:38:40 PM    7 |

Hey,

At first glance, I don’t think this is really linked to Render in any way. Are you able to bundle/run this application on your local machine?

Jérémy.
Render Support, UTC+3

Interesting. It runs fine on localhost. It happened when I used npm run dev instead of npm start. When I used npm start I got this error instead. One thing not note here is that I set node version in package.json as 18.16.0.

Oct 30 05:55:44 PM  [Error: ENOENT: no such file or directory, open '/opt/render/project/src/.next/BUILD_ID'] {
Oct 30 05:55:44 PM    errno: -2,
Oct 30 05:55:44 PM    code: 'ENOENT',
Oct 30 05:55:44 PM    syscall: 'open',
Oct 30 05:55:44 PM    path: '/opt/render/project/src/.next/BUILD_ID'
Oct 30 05:55:44 PM  }

Ok finallly it works when I use these in order

npm install
npm run build
npm start