TW-Elements
TW-Elements copied to clipboard
ReferenceError: document is not defined
NextJS applications fail to load when attempting to import tw-elements
; this is because the document
object is not available when using server-side rendering.
This comment seems to imply that the fix will be to wrap all references to document
in a check to ensure it's defined.
if(!(typeof document === "undefined")) {
// Handle document-related logic here
}
Hi, we just have launched bunch of integration tutorials - both with CSR and SSR frameworks. If you have more questions about integration or you still got some problems with particular components, let us know by adding new issue / topic in discussions section (if there are some unclear informations or just want let us know about something).