-
Notifications
You must be signed in to change notification settings - Fork 10.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
Gatsby with swagger-ui #11081
Comments
I also experienced this while not using Gatsby, and so this is probably related to your configuration and |
I can reproduce this @Meemaw Take a look at this comment in the issue linked by @itaisteinherz
It looks like the bundle isn't SSR friendly You could load this on the client side only in |
@Meemaw if you haven't already resolved this, i'm implementing a way to handle this. |
Hi, I have used the following workaround:
This way swagger will not be server-rendered. Instead, it will be loaded in the user's browser. |
Beware of this issue as well swagger-api/swagger-ui#4745 |
Sounds like this is an upstream issue with swagger-ui not being super server-side rendering friendly. I'd recommend following the remediation as @OrKoN mentioned here. Additionally, I think using null-loader may also help in this case. Since this is an issue outside of Gatsby and that seems to have a remediation, going to close this out. Please feel free to reply if we can help out further! |
I want to implement your solution: #11081 (comment) But, I am new to Gatsby. Can you tell me exactly where and how to place the code snippets you describe above for the client side rendering solution? Thanks in advance. It will be a big help. |
Hello! I'm trying to setup a documentation page with
swagger-ui
inside. I bootsraped my project withgatsby new example
. In one of my components I import swagger-ui as:This works when running locally, but fails at build time:
The text was updated successfully, but these errors were encountered: