Skip to content

ReferenceError: React is not defined #2573

@Denny-g6labs

Description

@Denny-g6labs

Describe the bug

The following error appears since today: ReferenceError: React is not defined.
We install the latest version globally and use it in our GitHub Action for the following command: npx redocly bundle ${dest_folder}/swagger.yaml -o ${dest_folder}/swagger-prepared.json

To Reproduce

  1. npm install -g @redocly/cli@latest
  2. redocly --help

Expected behavior

No error, exit code 0.

Logs

ReferenceError: React is not defined
    at Object.<anonymous> (/usr/local/lib/node_modules/@redocly/cli/node_modules/styled-components/dist/styled-components.cjs.js:1:860)
    at Module._compile (node:internal/modules/cjs/loader:1521:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1623:10)
    at Module.load (node:internal/modules/cjs/loader:1266:32)
    at Module._load (node:internal/modules/cjs/loader:1091:12)
    at Module.require (node:internal/modules/cjs/loader:1289:19)
    at require (node:internal/modules/helpers:182:18)
    at /usr/local/lib/node_modules/@redocly/cli/node_modules/redoc/bundles/redoc.lib.js:2:109941
    at /usr/local/lib/node_modules/@redocly/cli/node_modules/redoc/bundles/redoc.lib.js:1831:3804
    at /usr/local/lib/node_modules/@redocly/cli/node_modules/redoc/bundles/redoc.lib.js:1831:3809

Node.js v20.20.0

OpenAPI description

# See https://redocly.com/docs/cli/configuration/

extends:
  - recommended

rules:
  # Currently we don't have a license for our APIs
  info-license: "off"

theme:
  openapi:
    generateCodeSamples:
      languages:
        - lang: curl
        - lang: Node.js
        - lang: Python

Redocly version(s)

2.18.2

Node.js version(s)

v20.20.0

OS, environment

Linux, Max, GitHub ubuntu-latest

Additional context

It worked the last 3 years until today (can't say if it worked the last 2 days, but definitely before).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions