Skip to content

unable to upgrade to react 18 #33297

@newbcit

Description

@newbcit

Run next info (available from version 12.0.8 and up)

/bin/sh: 1: yarn: not found
/bin/sh: 1: pnpm: not found

Operating System:
  Platform: linux
  Arch: x64
  Version: #51~20.04.1-Ubuntu SMP Fri Jan 7 06:51:40 UTC 2022
Binaries:
  Node: 17.2.0
  npm: 8.0.0
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 12.0.8
  react: N/A
  react-dom: 18.0.0-rc.0

What version of Next.js are you using?

12.0.8

What version of Node.js are you using?

17.2

What browser are you using?

chrome, firefox

What operating system are you using?

ubuntu

How are you deploying your application?

I am not deploying it yet. Working in dev environment

Describe the Bug

When I run npm run dev after installing rc version of react and react-dom I keep getting following message:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /home/brum/Documents/xcode/suspense/node_modules/react/package.json

`at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.mod._resolveFilename (/home/brum/Documents/xcode/suspense/node_modules/next/dist/build/webpack/require-hook.js:179:28)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at getPackagePath (/home/brum/Documents/xcode/suspense/node_modules/next/dist/build/webpack-config.js:548:41)
at Object.getBaseWebpackConfig [as default] (/home/brum/Documents/xcode/suspense/node_modules/next/dist/build/webpack-config.js:564:9)`

{ code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' }

Expected Behavior

successfully run dev server on localhost:3000

To Reproduce

npm install next@latest react@rc react-dom@rc --legacy-peers-deps
npm run dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    UpstreamRelated to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions