redocly / create-react-app-redoc Goto Github PK
View Code? Open in Web Editor NEWExample of installing ReDoc into pure create-react-app app
Example of installing ReDoc into pure create-react-app app
When I replace the specUrl value with the location of a local yaml file (in the same folder) and run the app, the Loading page appears with an infinite spinner.
<RedocStandalone specUrl="https://redocly.github.io/redoc/openapi.yaml" />
replaced with
<RedocStandalone specUrl="openapi.yaml" />
I tried to run this project with react-scripts 5.0.0 and encountered the issues below, but it works fine with 4.0.3.
(could you please support this version of react-scripts ๐)
Compiled with problems:X
ERROR in ./node_modules/@redocly/openapi-core/lib/config/config.js 10:13-28
Module not found: Error: Can't resolve 'path' in '.../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 }
ERROR in ./node_modules/@redocly/openapi-core/lib/redocly/index.js 42:15-30
Module not found: Error: Can't resolve 'path' in '.../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 }
etc...
Hi @RomanHotsiy ,
I'm having the following problem:
Failed to compile ./node_modules/redoc/bundles/redoc.lib.js Module not found: Can't resolve 'core-js / es / promise' in
I cloned the project, I installed the modules from npm, I changed the original project's url because it pointed to a page with the following:
https://api.apis.guru/v2/specs/instagram.com/1.0.0/swagger.yaml
But it does not work.
When I try to add my .yaml
file I get an error
"http://localhost:3000/openapi.yaml" is not a valid JSON Schema
If I put it to the root or public/
How can reference specUrl to a local file ?
The tutorials and this template app do not build
or start
with the latest redoc
and react-scripts
versions due to many errors about polyfills for node.js core modules, all coming from redoc
code
This does not work:
"dependencies": {
"core-js": "^3.21.1",
"mobx": "^6.5.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"redoc": "^2.0.0-rc.66",
"styled-components": "^5.3.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
},
"devDependencies": {
"react-scripts": "^5.0.0"
}
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.
Keeping everything the same, but downgrading react-scripts, makes it work again.
"devDependencies": {
"react-scripts": "4.0.3"
}
react-scripts
hides webpack
configurations, so we cannot provide fallbacks as suggested. This was previously mentioned as being fixed a couple months ago, but I have been stuck on this error for 2 days until I figured out the downgrade workaround.
FYI: Had to delete yarn.lock to be able to install the dependencies as it was hanging at the beginning.
Hi @RomanHotsiy ,
I'm having the following problem:
#16 ,Doesn't work for me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.