-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiCollapsibleNav] document is not defined when using CollapsibleNav #4807
Comments
Hi @Paku580, It seems that EuiOverlayMask is not supported in server-side rendering. I'm not 100% familiar with next-js so it's better to open an issue here: https://github.com/elastic/next-eui-starter/issues. But I tested your code and this code seems to make it work: const [_document, set_document] = React.useState(null)
React.useEffect(() => {
set_document(document)
}, []) I found the solution here: https://stackoverflow.com/questions/60629258/next-js-document-is-not-defined. And I don't actually know if it's a good idea or not. 🤷🏽 |
Full support for server-side rendering isn't something we kept top-of-mind, but it is something we'd like to work towards. |
@miukimiu I would love to work on this issue. Can you guide me in solving this issue? |
How about this one. Check first is component is mounted before rendering the whole app.
|
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment. |
Hi, any volunteers here to fix that nasty thing? In my case that issue popped up, when using next + flyout + property
Quick fix:
FRom reading the source the fix would be to prevent calling document in |
I tried to add a
EuiCollapsibleNav
to your nextjs eui example here https://elastic.github.io/next-eui-starter/. This worked until i decided to restart the server. Then i got this weird error "document is not defined".StackTrace:
I then found out that this starter example doesn't use babel/polyfill so I thought this might be causing the problem.
So I added babel and the .babelrc file at the root of the project with following configuration:
This is the code i modified in the _app.tsx while trying to add the CollapsibleNav:
I tried several things to solve this none of it worked yet.
Since the starter example uses an older version I tried upgrading it but that didn't solve it either.
I am out of ideas and don't know if this is an actual issue in elastic ui or I am just missing any specific configuration.
Following this doc https://elastic.github.io/eui/#/layout/header#the-elastic-navigation-pattern the code seems right so I guess I am missing some configuration but couldn't find anything about it.
The text was updated successfully, but these errors were encountered: