You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@thompsongl Thanks for explanation. I've tried to replicate that Gatsby sample to NextJS but doesn't works for me. I hope that there will be some advancement toward SSR support in the future.
@b-barry Thank you for sharing your solution!
It eliminates HTMLElement and window issues, however I get the following error:
Attempted import error: 'DragDropContextProps' is not exported from 'react-beautiful-dnd'.
ModuleDependencyError: "export 'DragDropContextProps' was not found in 'react-beautiful-dnd'
I have react-beautiful-dnd installed, so I don't know what's the problem. I though it might be a problem with TS, but next.js has a built-in support for TS.
Did you encounter anything similar?
As long as you are using it as a back office, you don't need SSR. You can currently leverage the framework within nextJS using the above "hack". Ima write an article on that soon.
I think typescript support completed is more important atm.
@pugnascotia That starter is super useful! I did just drop this minor issue on it (elastic/next-eui-starter#5), as it seems that the nav drawer doesn't have the expected behavior when it's locked. Thanks again for adding it!
@pugnascotia +1 EuiCollapsibleNav has not the same behavior than others
ReferenceError: window is not defined
at EuiCollapsibleNav (webpack-internal:///./node_modules/@elastic/eui/lib/components/collapsible_nav/collapsible_nav.js:73:41)
Thanks to @pugnascotia for the NextJS starter for EUI. That satisfies the original ask of this issue. If you have special needs of the starter, please open an issue in that repo.
Activity
thompsongl commentedon Jun 24, 2019
Server-side rendering is certainly something we want to support, but we don't yet have it as a prioritized roadmap item.
We have done cursory exploration into making it work for basic prototyping with Gatsby. The gist is that node needs some polyfills for DOM globals (https://github.com/elastic/gatsby-eui-starter/blob/master/gatsby-node.js). Similar things would be possible with Next.js
next.config.js.If we get more formal with that ^ repo, we can update this issue with the approach.
elvenking commentedon Jun 26, 2019
@thompsongl Thanks for explanation. I've tried to replicate that Gatsby sample to NextJS but doesn't works for me. I hope that there will be some advancement toward SSR support in the future.
b-barry commentedon Jul 21, 2019
Hello,
I have transformed the gatsby config to a valid next.config.js
Kr,
thompsongl commentedon Jul 22, 2019
Thanks for that, @b-barry!
I'll give it a try soon
SavchenkoValeriy commentedon Jul 31, 2019
@b-barry Thank you for sharing your solution!
It eliminates
HTMLElementandwindowissues, however I get the following error:I have
react-beautiful-dndinstalled, so I don't know what's the problem. I though it might be a problem with TS, but next.js has a built-in support for TS.Did you encounter anything similar?
chandlerprall commentedon Jul 31, 2019
react-beautiful-dnditself doesn't provide TS types, you'll also need to install@types/react-beautiful-dndthompsongl commentedon Jul 31, 2019
I just opened an issue (#2185) related to those dnd types. I think we need to remove them from
es/andlib/SavchenkoValeriy commentedon Aug 1, 2019
@chandlerprall unfortunately, simple
yarn add @types/react-beautiful-dnddidn't make if for me. Still thanks for helping!@thompsongl great to hear!
ScreamZ commentedon Dec 1, 2019
This is working. Thanks @b-barry .
For those who missed, don't forget to add
null-loaderto dev depencies.ryanbelke commentedon Dec 8, 2019
+1 for SSR support in next.js, this would take EUI to the top in my opinion.. testing now with the configuration provided.
ScreamZ commentedon Dec 8, 2019
As long as you are using it as a back office, you don't need SSR. You can currently leverage the framework within nextJS using the above "hack". Ima write an article on that soon.
I think typescript support completed is more important atm.
ScreamZ commentedon Dec 21, 2019
@b-barry
Which configuration do you use for build with css… I was doing such a thing
To get CSS but looks like it's not shipped and with the above hack it only works in dev mode
pugnascotia commentedon Feb 24, 2020
Inspired by this post, I put together a Next.js starter. Feedback welcome!
ScreamZ commentedon Feb 24, 2020
@pugnascotia Oh! That's my post 😆 Glad to see that it is useful :)
it's not perfect as CSS is stripped and mocked, but it works, especially with static rendering :)
pugnascotia commentedon Feb 24, 2020
Yes, thank you very much @ScreamZ for the inspiration!
Can you elaborate? If something isn't working, I'd like to fix it. If you could open an issue on the repo, that'd be great 👍
nandorojo commentedon May 15, 2020
@pugnascotia That starter is super useful! I did just drop this minor issue on it (elastic/next-eui-starter#5), as it seems that the nav drawer doesn't have the expected behavior when it's locked. Thanks again for adding it!
sondh0127 commentedon Jun 5, 2020
Please support SSR for
EuiCollapsibleNav.EUI v24.1.0 + Next v9.4 got error:
ReferenceError: window is not definedCurrent solution:
ScreamZ commentedon Jun 5, 2020
@pugnascotia +1
EuiCollapsibleNavhas not the same behavior than othersnandorojo commentedon Jul 19, 2020
@ScreamZ Do you have a git repo for your Medium article? I like how minimal a starter would be from that piece.
ScreamZ commentedon Jul 19, 2020
@nandorojo
Nope because the article was small enough to allow reproduction from a barebones nextjs app
nandorojo commentedon Jul 19, 2020
@ScreamZ sounds good, I went ahead and did that, thanks!
cchaos commentedon Sep 18, 2020
Thanks to @pugnascotia for the NextJS starter for EUI. That satisfies the original ask of this issue. If you have special needs of the starter, please open an issue in that repo.