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

build-docs fails with React 19 #1824

Open
simoneguzzi opened this issue Dec 13, 2024 · 3 comments
Open

build-docs fails with React 19 #1824

simoneguzzi opened this issue Dec 13, 2024 · 3 comments
Labels
p2 Type: Bug Something isn't working

Comments

@simoneguzzi
Copy link

Hi All 👋 Thank you for the neat tool you developed 😎 I just updated my project to React 19, and the build-docs script seems to have a problem with that.

Describe the bug

build-docs fails with React 19.

To Reproduce
Steps to reproduce the behavior:

  1. I'm not using a config file
  2. Doesn't seem to be relevant
  3. node_modules/.bin/redocly build-docs your-openapi-schema.yaml
  4. Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.

Expected behavior

Script should run without errors.

Logs

❯ node_modules/.bin/redocly build-docs schema.yaml
Found undefined and using theme.openapi options
Prerendering docs
Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, key, props, _owner, _store}). If you meant to render a collection of children, use an array instead.

OpenAPI description

Redocly Version(s)

❯ node_modules/.bin/redocly --version
1.26.0

Node.js Version(s)

❯ node --version
v20.13.1

OS, environment

macOS 15.1.1 (24B91)

Additional context

@simoneguzzi simoneguzzi added the Type: Bug Something isn't working label Dec 13, 2024
@rsshilli
Copy link

rsshilli commented Dec 16, 2024

I'm having this problem and I don't have React declared at all. I see now the Redocly is pulling in the latest React and that's why I'm seeing this error.

Here's my patch to make it work:

Subject: [PATCH] Redocly failing on React 19
---
Index: package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/package.json b/package.json
--- a/package.json	(revision 75b42621a61d9e66ca968586b48b02aa0a22956c)
+++ b/package.json	(date 1734369197008)
@@ -105,7 +105,8 @@
     "punycode": "1.4.1",
     "puppeteer-core": "15.3.0",
+    "react": "18.3.1",
+    "react-dom": "18.3.1",
     "resolve-url-loader": "4.0.0",
     "sass": "1.53.0",
     "sass-loader": "10.4.1",

@tatomyr
Copy link
Contributor

tatomyr commented Dec 16, 2024

Thanks for rising this issue!

@AlexVarchuk could you check if that's a Redoc issue? Does it support React 19 at all?

@AlexVarchuk
Copy link
Contributor

Hi @tatomyr, I think it is a React 19 issue in Redoc. We'll look into it.

@AlexVarchuk AlexVarchuk added the p2 label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants