Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lastest Cleave.js breaks when component is server-side-rendered #365

Closed
anfedorov opened this issue Jun 8, 2018 · 2 comments
Closed

Lastest Cleave.js breaks when component is server-side-rendered #365

anfedorov opened this issue Jun 8, 2018 · 2 comments

Comments

@anfedorov
Copy link

anfedorov commented Jun 8, 2018

this

target.document = opts.document || document;

from here causes

ReferenceError: document is not defined
    at Object.assign (./node_modules/cleave.js/dist/cleave-react.js:2618:45)
    at Object.getInitialState (./node_modules/cleave.js/dist/cleave-react.js:133:47)
    at new <anonymous> (./node_modules/cleave.js/dist/cleave-react.js:1316:55)
    at ./node_modules/react-dom/lib/ReactCompositeComponent.js:292:18
    at measureLifeCyclePerf (./node_modules/react-dom/lib/ReactCompositeComponent.js:73:12)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (./node_modules/react-dom/lib/ReactCompositeComponent.js:291:16)
    at ReactCompositeComponentWrapper._constructComponent (./node_modules/react-dom/lib/ReactCompositeComponent.js:282:19)
    at ReactCompositeComponentWrapper.mountComponent (./node_modules/react-dom/lib/ReactCompositeComponent.js:185:21)
    at Object.mountComponent (./node_modules/react-dom/lib/ReactReconciler.js:43:35)
    at ReactDOMComponent.mountChildren (./node_modules/react-dom/lib/ReactMultiChild.js:234:44)
    at ReactDOMComponent._createContentMarkup (./node_modules/react-dom/lib/ReactDOMComponent.js:657:32)
    at ReactDOMComponent.mountComponent (./node_modules/react-dom/lib/ReactDOMComponent.js:524:29)
    at Object.mountComponent (./node_modules/react-dom/lib/ReactReconciler.js:43:35)
    at ReactDOMComponent.mountChildren (./node_modules/react-dom/lib/ReactMultiChild.js:234:44)
    at ReactDOMComponent._createContentMarkup (./node_modules/react-dom/lib/ReactDOMComponent.js:657:32)
    at ReactDOMComponent.mountComponent (./node_modules/react-dom/lib/ReactDOMComponent.js:524:29)

in my SSR node webserver process

@nosir
Copy link
Owner

nosir commented Jul 8, 2018

PR released: https://github.com/nosir/cleave.js/releases/tag/v1.3.8
@anfedorov @Lavoaster @nika-begiashvili
Sorry guys, please let me know if it's fixed

@nosir
Copy link
Owner

nosir commented Jul 8, 2018

NPM published too

@nosir nosir closed this as completed Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants