Skip to content

Warning about outdated JSX transform being used for Next.js apps with React 19 #27900

@lourd

Description

@lourd

Current Behavior

When generating a new Next.js application or library, using the React 19 RC, and running the default generated test, there's a console warning:

> jest

  console.warn
    Warning: Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform

       5 | describe("Page", () => {
       6 |   it("should render successfully", () => {
    >  7 |     const { baseElement } = render(<Page />)
         |                                    ^
       8 |     expect(baseElement).toBeTruthy()
       9 |   })
      10 | })

I cannot figure out where the outdated transform is being specified - babel-jest, the @nx/next/babel preset, or the underlying next babel preset.

Expected Behavior

The new JSX transform should be used during tests

GitHub Repo

No response

Steps to Reproduce

  1. Generate a new Nx workspace
  2. Generate a new Next.js application
  3. Be on one of the canary versions of Next.js v15 and one of the v19 RCs for react & react-dom
  4. Run the test for the Next.js application. See the warning

Nx Report

Node           : 20.12.1
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.7.0

nx                 : 19.7.2
@nx/js             : 19.7.2
@nx/jest           : 19.7.2
@nx/linter         : 19.7.2
@nx/eslint         : 19.7.2
@nx/workspace      : 19.7.2
@nx/devkit         : 19.7.2
@nx/esbuild        : 19.7.2
@nx/eslint-plugin  : 19.7.2
@nx/next           : 19.7.2
@nx/node           : 19.7.2
@nx/playwright     : 19.7.2
@nx/react          : 19.7.2
@nrwl/tao          : 19.7.2
@nx/vite           : 19.7.2
@nx/web            : 19.7.2
@nx/webpack        : 19.7.2
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/next/plugin
@nx/playwright/plugin
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions