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
}
Closing due to duplication: https://github.com/mdbootstrap/Tailwind-Elements/issues/1038