vercel / examples

Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications.
MIT License
3.57k stars 1.1k forks source link

Cannot find module jsx-runtime - web3-session template #461

Open crimson-med opened 1 year ago

crimson-med commented 1 year ago

I followed the web3-session installation guide with:

yarn create next-app --example https://github.com/vercel/examples/tree/main/solutions/web3-sessions

I then setup my .env

Then proceeded to run

yarn dev

When I try to access: http://localhost:3000 I get the following error:

event - compiled client and server successfully in 100 ms (336 modules)
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/web3-session/node_modules/react/jsx-runtime' imported from /web3-session/node_modules/@vercel/examples-ui/dist/index.js
Did you mean to import react/jsx-runtime.js?
    at new NodeError (node:internal/errors:372:5)
    at finalizeResolution (node:internal/modules/esm/resolve:437:11)
    at moduleResolve (node:internal/modules/esm/resolve:1009:10)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
    at link (node:internal/modules/esm/module_job:78:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
error - Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/web3-session/node_modules/react/jsx-runtime' imported from /web3-session/node_modules/@vercel/examples-ui/dist/index.js
Did you mean to import react/jsx-runtime.js?
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/web3-session/node_modules/react/jsx-runtime' imported from /web3-session/node_modules/@vercel/examples-ui/dist/index.js
Did you mean to import react/jsx-runtime.js?
    at new NodeError (node:internal/errors:372:5)
    at finalizeResolution (node:internal/modules/esm/resolve:437:11)
    at moduleResolve (node:internal/modules/esm/resolve:1009:10)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
    at link (node:internal/modules/esm/module_job:78:36) {
  code: 'ERR_MODULE_NOT_FOUND',
  page: '/'
}
evanrosa commented 1 year ago

Same issue, no solution that I've found yet.

Visualieyes commented 1 year ago

same here, and no solution found yet either

mworks-proj commented 1 year ago

Has anyone tried to manually adding: npm i jsx-runtime in project root?

mworks-proj commented 1 year ago

same here, and no solution found yet either

From root directory have you ran npm instal / i @jsx-runtime?

mworks-proj commented 1 year ago

same here, and no solution found yet either

Have you resolved this issue? I'm here to help.

andrewfowl commented 1 year ago

In package.json update versions for next, react, react-dom:

{ 
"next": "13.2.4",
"react": "18.2.0",
"react-dom": "18.2.0"
}

then run npm update then run npm upgrade then run npm install This worked for me.