redoc
redoc copied to clipboard
JavaScript heap out of memory and/or coredump
Describe the bug Redocly cli crash on docker and bare metal (node 18.16.1-1, node 20.4.0).
Expected behavior Generated documentation.
Minimal reproducible OpenAPI snippet(if possible) 1. docker run --rm -p 80:80 dockware/play:latest
wget -O shopware-admin-openapi3.json http://localhost/api/_info/openapi3.json?type=jsonapi
docker run --rm -v ./:/spec redocly/cli build-docs shopware-admin-openapi3.json
--> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
docker run --rm -v ./:/spec --env NODE_OPTIONS=--max_old_space_size=32000 redocly/cli build-docs shopware-admin-openapi3.json
--> ~18GB memory used --> coredump
Screenshots
Additional context
on bare metal: redocly lint shopware-admin-openapi3.json ... Woohoo! Your OpenAPI definition is valid. 🎉 You have 76 warnings.
npm list -g /usr/lib └── @redocly/[email protected]
this is default and minimal schema for shopware https://github.com/shopware/platform/
Thanks for letting us know about this. Please check if you have any circular references in your OpenAPI description, and also if you can build the docs on bare metal or if this problem is specific to docker? (note: may be related to Redocly/redoc#2474 )
Tested on bare metal too (node 18.16.1-1, node 20.4.0) the same problem
Please check if you have any circular references in your OpenAPI description
Is there a method/script to check this?
Maybe an option to ignore these references?
You can run redocly bundle openapi.json --dereferenced --output bundled.json. If your definition contains circular dependencies, it will bark at you. (Spoiler, there are).
However, I'm not sure this is the only issue here. Looks like there is something with React building a document on the server side.
I'm transferring it back since the issue is on Redoc / Reference Docs side. cc @AlexVarchuk