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.
Just started hitting this same issue when running npx redoc-cli bundle
Can confirm this is happening to me today as well. Had to revert to [email protected] to work around it.
No need to revert redoc-cli to a previous version. For me it works fine if I just pin [email protected]. redoc is a dep of redoc-cli:
https://github.com/Redocly/redoc/blob/6a97239f50c30d24f64e58aaffc800775cb07390/cli/package.json#L22
I use the resolutions field in the package.json in connection with yarn to fix this broken dep of a dep.
On the actual issue: Big issue! Hard to debug! Please fix fast (has not been fixed for 3 versions as it looks). Also for whoever picks this up: Please add a regression test. It is very surprising that this thing passed the tests before publication.
Hey all, sorry for the huge delay on this issue.
I've released [email protected], does it fix the issue?
Give some context please. Which changes did you publish and how should they fix this issue here? Where you able to reproduce the issue? Did you add a regression test?
I will try it out but I fear that the issue still persists because on a quick look on the commit history I see nothing that makes me think that things have changed for the better. Will report back and hopefully not waste my time.
BTW: What is the breaking change from this release? You increased the major version, right?
Fix works for me.
Another thing is this:
warning "workspace-aggregator-1e28af2b-ce8c-47ae-893f-af3602b24a52 > api > redoc-cli > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
warning "workspace-aggregator-1e28af2b-ce8c-47ae-893f-af3602b24a52 > api > redoc-cli > [email protected]" has unmet peer dependency "core-js@^3.1.4".
warning "workspace-aggregator-1e28af2b-ce8c-47ae-893f-af3602b24a52 > api > redoc-cli > redoc > [email protected]" has incorrect peer dependency "mobx@^5.15.4 || ^4.15.4".
warning "workspace-aggregator-1e28af2b-ce8c-47ae-893f-af3602b24a52 > api > redoc-cli > redoc > mobx-react > [email protected]" has incorrect peer dependency "mobx@^4.0.0 || ^5.0.0".
warning "workspace-aggregator-1e28af2b-ce8c-47ae-893f-af3602b24a52 > api > redoc-cli > redoc > swagger2openapi > [email protected]" has unmet peer dependency "[email protected] - 6".
You need to add these peerDeps of your deps as peerDeps of redoc-cli or add them as deps (I guess the first solution is better).
This was the fix: https://github.com/Redocly/redoc/commit/0ec03a34df0791fa8fb5608439598f96fcd72b4f
I'm waiting for a new release from mobx-react to fix those incorrect dependencies.
BTW: What is the breaking change from this release? You increased the major version, right?
The new version migrates to mobx@6. No breaking changes, just a major dep upgrade.
Thanks for the confirmation!
If the interface stays the same, then it should not be a new major version. I mean if someone has redoc-cli@^0.9 right now as a dep in their project, they have to manually set this to redoc-cli@^0.10 to get your fix. Why waste these peoples life time? If you had published the package as 0.9.13 everyone would get this fix for free...
BTW: You can still publish it also as 0.9.13, no harm done...
Well, this is caused by how semver works for 0.x.x releases.
Thanks for your suggestion. I just published it as 0.9.13 too.
Well, this is caused by how semver works for
0.x.xreleases.
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.
No need to revert
redoc-clito a previous version. For me it works fine if I just pin[email protected].redocis a dep ofredoc-cli:
https://github.com/Redocly/redoc/blob/6a97239f50c30d24f64e58aaffc800775cb07390/cli/package.json#L22I use the
resolutionsfield in thepackage.jsonin connection with yarn to fix this broken dep of a dep.
@Levino it works for me too with [email protected] except my left panel navigation menu links don't work with this version (they only work on Safari - no Chromium browsers). Are you seeing the same thing?
Most helpful comment
Can confirm this is happening to me today as well. Had to revert to [email protected] to work around it.