Skip to content

react/jsx-runtime.js is no longer available #2156

Closed
@hahnbeelee

Description

@hahnbeelee

Initial checklist

Affected packages and versions

https://mdxjs.com/guides/mdx-on-demand/

Link to runnable example

https://github.com/mintlify/mint/blob/a4c4c326901c29adda9788b569df44502cf94d1d/client/src/pages/_sites/%5Bsite%5D/%5B%5B...slug%5D%5D.tsx

Steps to reproduce

  1. cd client
  2. yarn dev

Expected behavior

I expect run & compile to work.

Actual behavior

There are a couple places in the docs that use:

import * as runtime from 'react/jsx-runtime.js'

However, when I try to replicate the code, I get the following error:

Error: Package subpath './jsx-runtime.js' is not defined by "exports" in /path/node_modules/react/package.json

I'm using React v^18.2.0 and I can't downgrade my React version. Is there something else I can provide as the second argument of run to get it to work? I see the run API documentation says I can provide "jsx, jsxs, and Fragment from an automatic JSX runtime as options", but I have no idea what that means. Do I provide a string(e.g. 'jsx')? Do I import something? I upload this as an issue because I think the docs need improvement and if anyone can show me the light, I'd be more than willing to make a PR fixing it as well :)

Runtime

Node v17

Package manager

yarn v1

OS

macOS

Build and bundle tools

Next.js

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions