redoc: Object(...) is not a function when bundling docs after 2.0.0-rc.42

Schema

openapi: "3.0.0"
info:
  description: a
  version: ''
  title: a
servers:
  - url: https://example.com
paths:
  /abc:
    post:
      tags:
        - Foo
      summary: 'Bar'
      description: Text
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: A

      responses:
        200:
          description: AAAA
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string

When I try to bundle, with no additional options, I get this error:

Prerendering docs
TypeError: Object(...) is not a function
    at new GroupModel (/redoc/node_modules/redoc/bundles/redoc.lib.js:10176:49)
    at /redoc/node_modules/redoc/bundles/redoc.lib.js:10286:29
    at Array.map (<anonymous>)
    at mapHeadingsDeep (/redoc/node_modules/redoc/bundles/redoc.lib.js:10285:26)
    at Function.MenuBuilder.addMarkdownItems (/redoc/node_modules/redoc/bundles/redoc.lib.js:10297:16)
    at Function.MenuBuilder.buildStructure (/redoc/node_modules/redoc/bundles/redoc.lib.js:10264:45)
    at new SpecStore (/redoc/node_modules/redoc/bundles/redoc.lib.js:10155:53)
    at new AppStore (/redoc/node_modules/redoc/bundles/redoc.lib.js:12798:21)
    at Module.<anonymous> (/redoc/node_modules/redoc/bundles/redoc.lib.js:12782:43)
    at step (/redoc/node_modules/tslib/tslib.js:140:27)

After some digging, I’m pretty sure this commit is the one causing the problem. https://github.com/Redocly/redoc/commit/a0f15d99f0a26d6ac5d79890da0f1b0cc4919c50 It errors on the new makeObservable(this) calls.

The same error happens on any version after 2.0.0-rc.41. The error doesn’t happen when I try to serve instead of bundle.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 13
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Can confirm this is happening to me today as well. Had to revert to redoc-cli@0.9.11 to work around it.

Well, this is caused by how semver works for 0.x.x releases.

Yes. If there is a zero in front, a change to the middle number indicates a breaking change and incompatibility. Thank you for the additional publication.

Just started hitting this same issue when running npx redoc-cli bundle