After last update to 0.10.0 redoc-cli bundle stop working.
How to reproduce:
$ docker run --rm -it node:latest bash
root@002d9cd64e60:/# npm install -g redoc-cli
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/redoc-cli/node_modules/mobx
npm WARN mobx@"^6.0.1" from [email protected]
npm WARN node_modules/redoc-cli
npm WARN redoc-cli@"*" from the root project
npm WARN 1 more (redoc)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer mobx@"^5.15.4 || ^4.15.4" from [email protected]
npm WARN node_modules/redoc-cli/node_modules/mobx-react
npm WARN mobx-react@"^6.2.2" from [email protected]
npm WARN node_modules/redoc-cli/node_modules/redoc
added 265 packages, and audited 265 packages in 12s
16 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm notice
npm notice New patch version of npm available! 7.0.3 -> 7.0.6
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.0.6
npm notice Run npm install -g [email protected] to update!
npm notice
root@002d9cd64e60:/# redoc-cli bundle /path/to/openapi3.yml
/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:20
throw new Error("[mobx] " + (message || OBFUSCATED_ERROR));
^
Error: [mobx] There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`
at invariant (/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:20:15)
at fail (/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:15:5)
at Timeout._onTimeout (/usr/local/lib/node_modules/redoc-cli/node_modules/mobx-react/node_modules/mobx/lib/mobx.js:1487:17)
at listOnTimeout (node:internal/timers:555:17)
at processTimers (node:internal/timers:498:7)
root@002d9cd64e60:/#
This is caused by new npm@7 (shipped with nod@15) is installing peer dependencies by default and a dependency we use (mobx-react) specifies the wrong peer dependency:
mobx@"^5.15.4 || ^4.15.4" from [email protected]
As a workaround use the LTS version of node.js.
I will open a pr aginst mobx-react later.
Fixed in [email protected]
Most helpful comment
This is caused by new npm@7 (shipped with nod@15) is installing peer dependencies by default and a dependency we use (mobx-react) specifies the wrong peer dependency:
mobx@"^5.15.4 || ^4.15.4" from [email protected]As a workaround use the LTS version of node.js.
I will open a pr aginst mobx-react later.