Topic: MDReact and Gatsby - Not working
- Gatsby does not work with React-Router thus I am having difficulties creating a proper navigation with all the wanted features.
- When building the production site it fails with an error. WebpackError: ReferenceError: window is not defined
Anna Morawska staff answered 6 years ago
chokeul8r commented 5 years ago
mdbootstrap is throwing an error on gatsby build. Works fine in dev mode but the minute you attempt to build for production it throws a webpack ssr error because it references the window ( "navigator" is not available during server side rendering. ). I was under the impression that mdbootstrap had resolved this issue when you decided to create a Gatsby Starter with the free version of your React Library. That is why I went ahead a purchased the Pro Version + Bundle.
Please tell me there is a work around.
Piotr Glejzer staff commented 5 years ago
we have a problem with SSR, we will try to resolve this as soon as possible. One component is breaking a whole server-side rendering and we are looking for a workaround this but there is a little problem with export-dynamic modules in the React because React doesn't support this yet. This will feature will be a core in the React ecosystem in the next version but we will fix it.
diznutz pro premium priority answered 3 years ago
Hello, is there any news related with solving MDB React integration with Gatsby? (or SSR frameworks in general). This is a critical stopper for our projects.
Wojciech Staniszewski staff answered 3 years ago
We do not support any frameworks yet. But you could try installing MDB5 React and check if it works
diznutz pro premium priority answered 3 years ago
Sadly, MDB5 React doesn't work either:
failed Building static HTML for pages - 6.710s
ERROR #95312
"document" is not available during server side rendering.
See our docs page for more info on this error:
https://gatsby.dev/debug-html
WebpackError: ReferenceError: document is not defined
- mdb-react-ui-kit.esm.js:1
[arga-intercultural]/[mdb-react-ui-kit]/dist/mdb-reac t-ui-kit.esm.js:1:35059
Is there any plan for supporting SSR frameworks in the near future?
Wojciech Staniszewski staff commented 3 years ago
It is definitely in our plans, but I cannot guarantee a date at this time
mark-steven-au pro premium answered 2 years ago
Has there been any progress on MDB5 and Gatsby working together yet? Would like to use MDB but only if it can work with Gatsby Cheers Mark
Krzysztof Wilk staff commented 2 years ago
Hi!
I'm afraid there's no update on this topic. But I think this answer should be helpful: https://mdbootstrap.com/support/react/install-with-latest-next-js-referenceerror-window-is-not-defined/
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: 4.7.1
- Device: All
- Browser: All
- OS: Windows
- Provided sample code: No
- Provided link: No