redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Not able to recognise modules imported from 'js-yaml' in react app

Open deprantik opened this issue 2 years ago • 2 comments

I am getting this following error while trying to render 'RedocStandalone' in a react project:

ERROR in ../../../@redocly/openapi-core/src/js-yaml/index.ts 16:9-13 export 'load' (imported as 'load') was not found in 'js-yaml' (possible exports: parseYaml, stringifyYaml)

npm version: 2.1.3 (latest version)

deprantik avatar Mar 26 '24 12:03 deprantik

WhatsApp Image 2024-04-09 at 19 27 54_3a1b32f3

nirajcoder373 avatar Apr 11 '24 16:04 nirajcoder373

Hi @deprantik, thank you for reporting the issue. Redoc 3 bundles its dependencies, including the YAML parser, so your bundler no longer has to resolve js-yaml from @redocly/openapi-core. The only peer dependencies are react, react-dom, react-router, styled-components and @redocly/config.

Please upgrade to redoc@3 (migration guide: https://redocly.com/docs/redoc-ce/config-migration). I'm closing this; reply if the error comes back and we'll reopen.

AlexVarchuk avatar Nov 09 '26 14:11 AlexVarchuk