-
Notifications
You must be signed in to change notification settings - Fork 9k
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
ReferenceError: window is not defined #6136
Comments
@char0n Can i try this one too? |
same error |
1 similar comment
same error |
@naima-shk sure, go ahead |
Having the same issue with Next.js dev server and |
Right, I looks like this issue is basically adding a support for SSR (Server Side Rendering). I can see that we use |
@char0n you're right the issue is SSR. I was able to solve this by disabling SSR and using Standard
Dynamically importing it in
Here is also a helpful resource: https://codeconqueror.com/blog/next-js-disable-ssr |
@fowad-sohail thank you for the workaround! |
Of course! It's a pleasure to help the community that's helped me countless times 😄 |
UPDATE: |
Has anyone managed to make this work in Gatsby or Docusaurus? |
@luizcieslak I tried to use this UI into a Docusaurus project, error is the same "Window is not defined" |
Q&A (please complete the following information)
Content & configuration
Didn't need any
YAML
file to reproduce this.Describe the bug you're encountering
ReferenceError: window is not defined
I have experience this both with Next.js and Docusaurus.
To reproduce...
Steps to reproduce the behavior:
yarn create next-app
- I choose "swagger-test" as project name and Default templatecd swagger-test
yarn add swagger-ui-react
index.js
to just serve SwaggerUI:yarn dev
to start dev serverExpected behavior
Expect SwaggerUI to work with frameworks/libraries like Next.JS and Docusaurus that have server code where window isn't defined.
The text was updated successfully, but these errors were encountered: