Skip to content

Breaking in NextJs (SSR): Changes from Pull request #124 are not present in latest src #609

@samratarmas

Description

@samratarmas

Hello team,

There was a merge of pull request #124 to address ssr last year, however, the latest source code is missing those changes.

Currently flowbite-react in Nextjs results in numerous errors all related to code accesing document or window when it is not yet present. You can replicate this yourself by importing modal components inside nextjs app. The error that I am getting is:

ReferenceError: document is not defined at ModalComponent (webpack-internal:///(sc_client)/../../node_modules/flowbite-react/lib/cjs/components/Modal/Modal.js:17:50)

This error stems from the line:
root = document.body present in Modal.tsx

Originally posted by @samratarmas in #123 (comment)

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't workingconfirmedThis bug was confirmed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions