redoc: Webpack 5 `Cant Resolve` errors in `v2.0.0-rc.58`
Describe the bug Running Redoc Standalone in Docusaurus 2.0.0-beta.9 and getting webpack issues stemming from the redoc openapi-core library, which does not seem to be open source
Module not found: Error: Can't resolve 'path' in '/Users/mySite/site/node_modules/@redocly/openapi-core/lib/config'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
Module not found: Error: Can't resolve 'path' in '/Users/mySite/site/node_modules/@redocly/openapi-core/lib/redocly'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
Module not found: Error: Can't resolve 'os' in '/Users/mySite/site/node_modules/@redocly/openapi-core/lib/redocly'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
Module not found: Error: Can't resolve 'path' in '/Users/mySite/site/node_modules/@redocly/openapi-core/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
Module not found: Error: Can't resolve 'tty' in '/Users/mySite/site/node_modules/@redocly/openapi-core/node_modules/colorette'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "tty": require.resolve("tty-browserify") }'
- install 'tty-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "tty": false }
Module not found: Error: Can't resolve 'buffer' in '/Users/mySite/site/node_modules/yaml/browser/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }
client (webpack 5.65.0) compiled with 6 errors and 1 warning
Expected behavior Page should render without Webpack/polyfill issues
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 24
- Comments: 27
Same - seeing it on Docusaurus 2.0.0-beta.14. I’m trying to upgrade a batch of Docusaurus instances, but can’t do it until the Redoc integration works again.
Seeing the same with rc59 and a clean CRA install with typescript
Workaround Revert the react-scripts version in package.json to
Closed! PR.
i get the same problem in Docusaurus 2.0.0-beta.14
@AlexVarchuk The error log as follow
Fresh clone of the repo did it - workaround confirmed. Thanks @AlexVarchuk! Ill keep an eye on the other issue and greatly appreciate your support!
@ajrice6713 thank you a lot for the additional information. I reopen this issue and investigate the problem