Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocean node dashboard: Cannot find module 'react/jsx-dev-runtime' #713

Open
juniormayhe opened this issue Oct 13, 2024 · 0 comments
Open
Labels
Type: Bug Something isn't working

Comments

@juniormayhe
Copy link

juniormayhe commented Oct 13, 2024

Describe the bug
Starting the dashboard after build crashes nextjs application.

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo, go to dashboard directory, ensure you have node, npm and nvm installed. node version should be v20.16.0, according to Dockerfile
node -v
v20.16.0

npm -v
10.8.1

nvm -v
0.39.5
  1. Run commands
npm i
up to date, audited 1301 packages in 7s

210 packages are looking for funding
  run `npm fund` for details

21 vulnerabilities (2 low, 3 moderate, 16 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.8.1 -> 10.9.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.0
npm notice To update run: npm install -g [email protected]
npm notice
npm run dev

> [email protected] dev
> next dev

 ⨯ API Routes cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export
  ▲ Next.js 13.5.6
  - Local:        http://localhost:3000

 ✓ Ready in 1950ms
  1. Browse http://localhost:3000

  2. See error in terminal output ⨯ Error: Cannot find module 'react/jsx-dev-runtime'

 ⨯ Error: Cannot find module 'react/jsx-dev-runtime'
Require stack:
- /home/junior/ocean-node/dist/dashboard/server/pages/_document.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/require.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/load-components.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/build/utils.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-middleware.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-reloader-webpack.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-server.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/start-server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at /home/junior/ocean-node/dashboard/node_modules/next/dist/server/require-hook.js:54:36
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at mod.require (/home/junior/ocean-node/dashboard/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/helpers:179:18)
    at react/jsx-dev-runtime (/home/junior/ocean-node/dist/dashboard/server/pages/_document.js:52:18)
    at __webpack_require__ (/home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/pages/_document.tsx:5:79)
    at ./src/pages/_document.tsx (/home/junior/ocean-node/dist/dashboard/server/pages/_document.js:22:1)
    at __webpack_require__ (/home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js:33:42)
    at __webpack_exec__ (/home/junior/ocean-node/dist/dashboard/server/pages/_document.js:72:39)
    at /home/junior/ocean-node/dist/dashboard/server/pages/_document.js:73:104
    at __webpack_require__.X (/home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js:185:21)
    at /home/junior/ocean-node/dist/dashboard/server/pages/_document.js:73:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/junior/ocean-node/dist/dashboard/server/pages/_document.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/require.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/load-components.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/build/utils.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-middleware.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-reloader-webpack.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-server.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/start-server.js'
  ],
  page: '/'
}
 ✓ Compiled /_error in 308ms (3500 modules)
Error: Cannot find module 'react/jsx-dev-runtime'
Require stack:
- /home/junior/ocean-node/dist/dashboard/server/pages/_document.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/require.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/load-components.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/build/utils.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-middleware.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-reloader-webpack.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-server.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/start-server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at /home/junior/ocean-node/dashboard/node_modules/next/dist/server/require-hook.js:54:36
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at mod.require (/home/junior/ocean-node/dashboard/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/helpers:179:18)
    at react/jsx-dev-runtime (/home/junior/ocean-node/dist/dashboard/server/pages/_document.js:52:18)
    at __webpack_require__ (/home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/pages/_document.tsx:5:79)
    at ./src/pages/_document.tsx (/home/junior/ocean-node/dist/dashboard/server/pages/_document.js:22:1)
    at __webpack_require__ (/home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js:33:42)
    at __webpack_exec__ (/home/junior/ocean-node/dist/dashboard/server/pages/_document.js:72:39)
    at /home/junior/ocean-node/dist/dashboard/server/pages/_document.js:73:104
    at __webpack_require__.X (/home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js:185:21)
    at /home/junior/ocean-node/dist/dashboard/server/pages/_document.js:73:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/junior/ocean-node/dist/dashboard/server/pages/_document.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/require.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/load-components.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/build/utils.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-middleware.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-reloader-webpack.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-server.js',
    '/home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/start-server.js'
  ]
}

  1. See error in browser
 1 of 1 unhandled error
Server Error
Error: Cannot find module 'react/jsx-dev-runtime'
Require stack:
- /home/junior/ocean-node/dist/dashboard/server/pages/_document.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/require.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/load-components.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/build/utils.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-middleware.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/dev/hot-reloader-webpack.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-utils/setup-dev-bundler.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/router-server.js
- /home/junior/ocean-node/dashboard/node_modules/next/dist/server/lib/start-server.js

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Module._resolveFilename
node:internal/modules/cjs/loader (1225:15)
<unknown>
file:///home/junior/ocean-node/dashboard/node_modules/next/dist/server/require-hook.js (54:36)
Module._load
node:internal/modules/cjs/loader (1051:27)
Module.require
node:internal/modules/cjs/loader (1311:19)
mod.require
file:///home/junior/ocean-node/dashboard/node_modules/next/dist/server/require-hook.js (64:28)
require
node:internal/modules/helpers (179:18)
react/jsx-dev-runtime
file:///home/junior/ocean-node/dist/dashboard/server/pages/_document.js (52:18)
__webpack_require__
file:///home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js (33:42)
eval
webpack-internal:///./src/pages/_document.tsx (5:79)
./src/pages/_document.tsx
file:///home/junior/ocean-node/dist/dashboard/server/pages/_document.js (22:1)
__webpack_require__
file:///home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js (33:42)
__webpack_exec__
file:///home/junior/ocean-node/dist/dashboard/server/pages/_document.js (72:39)
<unknown>
file:///home/junior/ocean-node/dist/dashboard/server/pages/_document.js (73:104)
__webpack_require__.X
file:///home/junior/ocean-node/dist/dashboard/server/webpack-runtime.js (185:21)
<unknown>
file:///home/junior/ocean-node/dist/dashboard/server/pages/_document.js (73:47)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.3 LTS
  • Browser Edge Version 129.0.2792.89 (Official build) (64-bit)

Additional context

image

@juniormayhe juniormayhe added the Type: Bug Something isn't working label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant