redocly-cli
redocly-cli copied to clipboard
Hydration Error related with Download Button
Describe the bug
I tried to upgrade from "@redocly/cli": "1.27.0" to "@redocly/cli": "1.34.3", but hydration errors appear on Browser's Console with messages:
Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. Uncaught Error: Minified React error #423; visit https://reactjs.org/docs/error-decoder.html?invariant=423 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
When I deactivate the download button in redocly's configuration file:
theme:
openapi:
hideDownloadButton: true
the above errors are fixed.
To Reproduce Steps to reproduce the behavior:
- Given this
redocly.yamlfile:
extends:
- recommended
apis:
main:
root: openapi.yaml
theme:
openapi:
hideDownloadButton: false
- And this OpenAPI file:
openapi: 3.0.3
info:
title: Sample API
version: 1.0.0
description: A simple example of OpenAPI with Redocly.
servers:
- url: https://api.example.com/v1
paths:
/hello:
get:
summary: Returns a greeting
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
message:
type: string
-
Run this command with these arguments: Using @redocly/cli version 1.34.3 run:
redocly build-docs --disableGoogleFont openapi.yaml -o dist/index.html -
See error Serve the created
dist/index.htmlfile and open it with a Browser (tested on Firefox and Chrome). Choose toInspectthe created API Docs and go to the tabConsole. The hydration messages (mentioned in the description above) will be reported. -
Repeat without the Download Button Set
hideDownloadButtonto true in redocly.yaml and rebuild the docs:redocly build-docs --disableGoogleFont openapi.yaml -o dist/index.htmlServe the static file and inspect it in your browser. No errors should be logged there.
Expected behavior Download button does not cause any hydration errors.
OpenAPI description
OpenAPI version: 3.0.3
Redocly Version(s) "@redocly/cli": "1.34.3"
Node.js Version(s)
v20.19.2
OS, environment
Ubuntu 24.04.2 LTS
Additional context
API Docs work as expected until "@redocly/cli": "1.28.3"
Seems to have been introduced in 1.28.4 when upgrading Redoc from 2.2.0 to 2.4.0.
@AlexVarchuk could you take a look at that?