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 19 support #39180

Open
2 tasks done
Schweinepriester opened this issue Dec 7, 2024 · 1 comment
Open
2 tasks done

React 19 support #39180

Schweinepriester opened this issue Dec 7, 2024 · 1 comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@Schweinepriester
Copy link

Preliminary Checks

Description

https://react.dev/blog/2024/12/05/react-19

Reproduction Link

https://github.com/gatsbyjs/gatsby/blob/gatsby%405.14.0/packages/gatsby/package.json#L253

Steps to Reproduce

  1. Check https://github.com/gatsbyjs/gatsby/blob/gatsby%405.14.0/packages/gatsby/package.json#L253
  2. React 19 is not matched by ^18.0.0 || ^0.0.0
  3. Probably other changes needed as well

Expected Result

React 19 is supported

Actual Result

React 19 is not supported

Environment

Any

Config Flags

No response

@Schweinepriester Schweinepriester added the type: bug An issue or pull request relating to a bug in Gatsby label Dec 7, 2024
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 7, 2024
@CSharperMantle
Copy link

Able to confirm the incompatibility.

App fails to build w/ Gatsby 5.14.1, producing the following stacktrace:

success Building HTML renderer - 62.578s
 ERROR  UNKNOWN
Cannot read properties of undefined (reading 'ContextRegistry')
  TypeError: Cannot read properties of undefined (reading 'ContextRegistry')
  - render-page.js:29242 21011
    [PROJECT]/.cache/page-ssr/routes/render-page.js:29242:461
  - render-page.js:53701 __webpack_require__
    [PROJECT]/.cache/page-ssr/routes/render-page.js:53701:42
  - render-page.js:29314 29592
    [PROJECT]/.cache/page-ssr/routes/render-page.js:29314:20
  - render-page.js:53701 __webpack_require__
    [PROJECT]/.cache/page-ssr/routes/render-page.js:53701:42
  - render-page.js:53860
    [PROJECT]/.cache/page-ssr/routes/render-page.js:53860:331
  - render-page.js:53894
    [PROJECT]/.cache/page-ssr/routes/render-page.js:53894:3
  - render-page.js:53899 Object.<anonymous>
    [PROJECT]/.cache/page-ssr/routes/render-page.js:53899:12
  [LOADER ENTRIES OMITTED...]
  - page-mode.js:108 preparePageTemplateConfigs
    [gatsby-virtual-790e62beba]/[gatsby]/dist/utils/page-mode.js:108:24

not finished Execute page configs - 0.487s

It seems that one of Gatsby's dependencies tries to access some React internals:

/**
 * @license React
 * react-server-dom-webpack-writer.node.production.min.server.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
...
var ra=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=ra.ContextRegistry,O=ra.ReactCurrentDispatcher;
...

The dependencies in included here:

"react-server-dom-webpack": "0.0.0-experimental-c8b778b7f-20220825",

The React 19 changelog shows that they have indeed changed internal states.

https://react.dev/blog/2024/04/25/react-19-upgrade-guide#libraries-depending-on-react-internals-may-block-upgrades

Related lines of deps:

{
    "gatsby": "^5.14.1",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants