-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redoc demo readFile undefined #2009
Comments
Hi @ocole007, we released the next version Please verify or add additional steps to reproduce(browser version, OS, etc) |
I'm getting the same error. |
Hi @jaaufauvre, can you add me steps to reproduce and some additional information(browser version, OS, screenshot of network tab, etc) |
Hi @AlexVarchuk, Edge 101.0.1210.47, Chrome 101.0.4951.64, Brave 101.0.4951.41 Windows 10, Windows 11
|
@jaaufauvre we redeployed the demo page. |
Hi @AlexVarchuk, nop it didn't help. It works with Firefox though. |
Hi @AlexVarchuk , upon further inspection, this could be a CORS issue as I tested without CORS checked and it worked in some instances. |
Hi @ocole007. Seems it can be true. We have a special checkbox for it. One of the cases should be working. |
I missed it. 🙈 |
I close this issue. Because it is expected behavior. The demo page should work in one of the CORS cases (enabled/disabled). |
@AlexVarchuk - This tread helped me identify an issue that I was having. As a suggestion - It would be good if you handled the error, and correctly reported it in user friendly way - It would simplify the understanding of the issue, and make the tool easier to use. - Great Tool BTW :) |
The API docs gives only an error currently. Adding `&nocors` aparently helps. (maybe browser dependent?) See: Redocly/redoc#2009 for background
The API docs gives only an error currently. Adding `&nocors` aparently helps. (maybe browser dependent?) See: Redocly/redoc#2009 for background
It looks like this problem still exists.
I've debugged this and it seems that different browsers have different ways of handling the URL constructor. new URL("\\\\cors.redoc.ly/https://apiland.deno.dev/~/spec", "https://redocly.github.io/redoc/?url=https://apiland.deno.dev/~/spec") I think maybe correcting the url in this line from Line 89 in 3d410b6
|
Describe the bug
When we use the "Try It" feature at https://redocly.github.io/redoc/ e.g. https://redocly.github.io/redoc/?url=https://docs.graphhopper.com/openapi.json, an exception is raised.
Expected behavior
The URL passed to redoc should render the based on the swagger JSON description.
Minimal reproducible OpenAPI snippet(if possible)
Screenshots
Cannot read properties of undefined (reading 'readFile')
Stack trace
Error: Cannot read properties of undefined (reading 'readFile')
at t.BaseResolver. (https://redocly.github.io/redoc/redoc-demo.bundle.js:2:27238)
at Generator.next ()
at https://redocly.github.io/redoc/redoc-demo.bundle.js:2:25385
at new Promise ()
at r (https://redocly.github.io/redoc/redoc-demo.bundle.js:2:25130)
at t.BaseResolver.loadExternalRef (https://redocly.github.io/redoc/redoc-demo.bundle.js:2:27020)
at t.BaseResolver. (https://redocly.github.io/redoc/redoc-demo.bundle.js:2:27751)
at Generator.next ()
at https://redocly.github.io/redoc/redoc-demo.bundle.js:2:25385
at new Promise ()
ReDoc Version: 2.0.0-rc.68
Commit: 494122f
Additional context
The text was updated successfully, but these errors were encountered: