-
Notifications
You must be signed in to change notification settings - Fork 9.2k
"Unable to render this definition" error solutions not working #8586
-
Hey swagger team,
I need some help with implementing swagger-ui-react in my Next.js app. I found this issue thread #8245 to solve my initial error message ("SyntaxError: Cannot use import statement outside a module") but I tried this solution and I get this error:
Screen Shot 2023年04月21日 at 10 53 34 PM
I also noticed that when I change the spec file (was testing json and yml formats if it would behave differently- it doesn't), the spec file didn't change from json to yml based on what I specified..it just kept the first file I tried & I verified this in my console.log. SO, I tried a different solution I found in that issue thread to dynamically import swagger-ui-react, and that solved the "spec file not changing to what I define" issue. But, I still get the same exact error message as pictured above.
My spec file specifies "openapi": "3.0.2" at the top. I tested changing it to "3.0.1" & tested adding "swagger": "2.0" above the openapi version as well, but none of this worked & I still get that error message. I tested this out at https://editor.swagger.io/ & the UI of my openapi spec file renders perfectly.
Not sure what I need to do to get this working as my openapi spec meets the requirements of the error message. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 6 replies
-
Have you managed yo overcome this error?
I'm facing a similar one, and yet cannot find a solution to it
Beta Was this translation helpful? Give feedback.
All reactions
-
same here
Beta Was this translation helpful? Give feedback.
All reactions
-
same here!
Beta Was this translation helpful? Give feedback.
All reactions
-
As above
Beta Was this translation helpful? Give feedback.
All reactions
-
Same here!!
Beta Was this translation helpful? Give feedback.
All reactions
-
Also here.
Beta Was this translation helpful? Give feedback.