Skip to content

Breaks server side rendering #47

Description

@samdturner

We run a react app that uses server side rendering.

When we import react-ladda, we get the following error message. The error goes away when we comment out the line that imports react-ladda.

ERROR in SERVER PRERENDERING
Encountered error: "ReferenceError: document is not defined"

We have traced the issue back to the ladda package (required by react-ladda). The below file accesses the document directly, but the document is not defined in node.js (I would open an issue in Ladda directly, but it looks like issues have been disabled in that package.)

https://github.com/hakimel/Ladda/blob/e5fa9e7681334a47419a126bdcb6aaefd05424da/js/ladda.js

Has anyone else encountered this issue before and what approach do you recommend?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions