You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReferenceError: name is not defined
at /ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:9404:124
at mapValues (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:7269:24)
at new FieldModel (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:9404:29)
at /ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:9741:50
at Array.map ()
at OperationModel.get (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:9741:15)
at OperationModel.get (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:8600:42)
at Object.children (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:14129:97)
at ReactDOMServerRenderer.render (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:3635:55)
at ReactDOMServerRenderer.read (/ifs/home/mbryan/.npm/_npx/3518/lib/node_modules/redoc-cli/node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29)
It appears this happens on 0.10.2 and not 0.10.1. It happens with some YAML files and not others, and presumably that is why I'm the first to report it. Probably I have a weird edge-case of a YAML file, though: the repro below is pretty minimal.
I've made a semi-minimalist version of the file that reproduces the issue. The 'examples' clause seems to be a crucial part of it.
That line:
.../node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:9404:124
points to the variable "name" but there is no such variable.
It should refer to the "this.name" assigned on line 9391.
My javascript isn't strong enough to figure out how "name" on line 9404 can refer to "this.name" on line 9391 so I added a local variable:
Activity
StephaneLambert commentedon Dec 18, 2020
Same trouble for me with NodeJS 12.19 et redoc-cli 0.10.2, not with 0.10.1.
Clarification:
redoc-cli serveis OK whileredoc-cli bundleis NOT.My YAML sample :
dowy commentedon Mar 7, 2021
That line:
.../node_modules/redoc-cli/node_modules/redoc/bundles/redoc.lib.js:9404:124
points to the variable "name" but there is no such variable.
It should refer to the "this.name" assigned on line 9391.
My javascript isn't strong enough to figure out how "name" on line 9404 can refer to "this.name" on line 9391 so I added a local variable:
I leave it to someone who knows what they're doing to raise a patch for this.
EvanCarroll commentedon Mar 26, 2021
@RomanHotsiy why was this issue closed?
EvanCarroll commentedon Mar 26, 2021
@dowy I'm confused how this isn't broken for everyone.
RomanHotsiy commentedon Mar 26, 2021
@EvanCarroll because It was fixed.
Could you specify more details? Which version of openapi-cli do you use? What node version?
RomanHotsiy commentedon Mar 26, 2021
@EvanCarroll I just tested it again and it works for me on the latest redoc-cli@0.10.4 version.
Redoc update (#5)
fix: crash on multiple examples on parameter object