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 warning on standard out when generating HTML documentation #2536

Closed
g-dx opened this issue Apr 29, 2024 · 1 comment · Fixed by #2547
Closed

React warning on standard out when generating HTML documentation #2536

g-dx opened this issue Apr 29, 2024 · 1 comment · Fixed by #2547

Comments

@g-dx
Copy link

g-dx commented Apr 29, 2024

Given the following files:

apis.yaml

openapi: "3.0.0"
info:
  version: 1.0.0
  title: Swagger Petstore
  license:
    name: MIT
servers:
  - url: http://petstore.swagger.io/v1
paths:
  /pets:
    get:
      summary: List all pets
      responses:
        '200':
          description: A paged array of pets
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Pets"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    Pet:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
    Pets:
      type: array
      maxItems: 100
      items:
        $ref: "#/components/schemas/Pet"
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string

redocly.yaml

extends:
  - recommended

apis:
  public:
    root: ./apis.yaml
    decorators:
      remove-x-internal: on

theme:  
  openapi:
    expandDefaultServerVariables: true
    pathInMiddlePanel: true
    theme:
      typography:
        headings:
          fontWeight: bold
  1. Run the following command:

    npx @redocly/cli@1.12.0 build-docs apis.yaml --config ./redocly.yml --output ./index.html

    Produces the following output:

    Found ./redocly.yml and using theme.openapi options
    Prerendering docs
    Warning: Tabs: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
        at Tabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/Tabs.js:72:24)
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at lu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1672:877)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at observerComponent (/home/user/.npm/_npx/5f30b3299d387346/node_modules/mobx-react-lite/dist/mobxreactlite.cjs.development.js:263:12)
        at Cu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:2933)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at $u (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1856)
        at ju (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1688)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at exports.ThemeProvider (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:27633)
        at dd (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1825:2282)
        at Be (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:16490)
    Warning: UncontrolledTabs: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
        at UncontrolledTabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/UncontrolledTabs.js:86:36)
        at Tabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/Tabs.js:72:24)
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at lu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1672:877)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at observerComponent (/home/user/.npm/_npx/5f30b3299d387346/node_modules/mobx-react-lite/dist/mobxreactlite.cjs.development.js:263:12)
        at Cu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:2933)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at $u (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1856)
        at ju (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1688)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at exports.ThemeProvider (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:27633)
        at dd (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1825:2282)
        at Be (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:16490)
    Warning: TabList: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
        at TabList (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/TabList.js:29:24)
        at div
        at UncontrolledTabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/UncontrolledTabs.js:86:36)
        at Tabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/Tabs.js:72:24)
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at lu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1672:877)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at observerComponent (/home/user/.npm/_npx/5f30b3299d387346/node_modules/mobx-react-lite/dist/mobxreactlite.cjs.development.js:263:12)
        at Cu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:2933)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at $u (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1856)
        at ju (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1688)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at exports.ThemeProvider (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:27633)
        at dd (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1825:2282)
        at Be (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:16490)
    Warning: Tab: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
        at Tab (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/Tab.js:56:35)
        at ul
        at TabList (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/TabList.js:29:24)
        at div
        at UncontrolledTabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/UncontrolledTabs.js:86:36)
        at Tabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/Tabs.js:72:24)
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at lu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1672:877)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at observerComponent (/home/user/.npm/_npx/5f30b3299d387346/node_modules/mobx-react-lite/dist/mobxreactlite.cjs.development.js:263:12)
        at Cu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:2933)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at $u (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1856)
        at ju (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1688)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at exports.ThemeProvider (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:27633)
        at dd (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1825:2282)
        at Be (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:16490)
    Warning: TabPanel: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
        at TabPanel (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/TabPanel.js:42:24)
        at div
        at UncontrolledTabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/UncontrolledTabs.js:86:36)
        at Tabs (/home/user/.npm/_npx/5f30b3299d387346/node_modules/react-tabs/lib/components/Tabs.js:72:24)
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at lu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1672:877)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at observerComponent (/home/user/.npm/_npx/5f30b3299d387346/node_modules/mobx-react-lite/dist/mobxreactlite.cjs.development.js:263:12)
        at Cu (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:2933)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at $u (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1856)
        at ju (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1674:1688)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at div
        at I (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:22689)
        at exports.ThemeProvider (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:27633)
        at dd (/home/user/.npm/_npx/5f30b3299d387346/node_modules/redoc/bundles/redoc.lib.js:1825:2282)
        at Be (/home/user/.npm/_npx/5f30b3299d387346/node_modules/styled-components/dist/styled-components.cjs.js:1:16490)

Expected behavior

HTML should be generated without console warnings

Logs

OpenAPI description

Redocly Version(s)

1.12.0

Node.js Version(s)

v18.19.1

@g-dx g-dx added the Type: Bug label Apr 29, 2024
@Oprysk Oprysk transferred this issue from Redocly/redocly-cli May 3, 2024
@brettgoss
Copy link

Is there any way to work around this issue? It's occurring across all @redocly/cli versions, so downgrading doesn't help.

It seems to be coming from the usage of react-tabs here: https://github.com/Redocly/redoc/blob/main/src/common-elements/tabs.ts, which was resolved by react-tabs in their 6.0.1 release: reactjs/react-tabs#518.

Is it feasible to upgrade from react-tabs ^4.3.0 to ^6.0.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants