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

React 18RC Upgrade not working #32587

Closed
adesugbaa opened this issue Dec 16, 2021 · 3 comments
Closed

React 18RC Upgrade not working #32587

adesugbaa opened this issue Dec 16, 2021 · 3 comments
Labels
Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).

Comments

@adesugbaa
Copy link

adesugbaa commented Dec 16, 2021

What version of Next.js are you using?

12.0.7

What version of Node.js are you using?

17.2.0

What browser are you using?

Chrome

What operating system are you using?

MacOS Monterey

How are you deploying your application?

Vercel

Describe the Bug

I have an existing application (in production), and wanted to try out the React18 features.

When I upgrade the rear versions using:

yarn add react@rc react-dom@rc

The application refuses to compile/start:

yarn dev                      
yarn run v1.22.17
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Loaded env from /Users/ayorinde/Dev/Git/Others/jtv.nextjs/.env.local
info  - Using the createRoot API for React
warn  - You are using an unsupported prerelease of 'react-dom' which may cause unexpected or broken application behavior. Continue at your own risk.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /Users/ayorinde/Dev/Git/Others/jtv.nextjs/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 (/Users/ayorinde/Dev/Git/Others/jtv.nextjs/node_modules/next/dist/build/webpack/require-hook.js:171:28)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at getPackagePath (/Users/ayorinde/Dev/Git/Others/jtv.nextjs/node_modules/next/dist/build/webpack-config.js:601:41)
    at Object.getBaseWebpackConfig [as default] (/Users/ayorinde/Dev/Git/Others/jtv.nextjs/node_modules/next/dist/build/webpack-config.js:617:9) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How do we opt in to React18, and try out the new features?

Expected Behavior

I expect the application to compile, and start accepting/responding to requests.

To Reproduce

Create a next application, and upgrade to React18 following this link

@adesugbaa adesugbaa added the bug Issue was opened via the bug report template. label Dec 16, 2021
@chuvikovd
Copy link

Experienced same issue. However, works fine with node@16.

@balazsorban44 balazsorban44 added kind: bug and removed bug Issue was opened via the bug report template. labels Dec 18, 2021
@balazsorban44
Copy link
Member

balazsorban44 commented Dec 18, 2021

This seems to be coming from react itself.

PR already merged facebook/react#22783, probably released soon.
Another potentially relevant PR: facebook/react#22954

Good catch BTW, thanks for reporting 👍

@balazsorban44 balazsorban44 added the Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.). label Dec 18, 2021
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Projects
None yet
Development

No branches or pull requests

3 participants