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

SSR in 4.4.0 crashes #618

Closed
perrin4869 opened this issue May 5, 2020 · 12 comments · Fixed by #619
Closed

SSR in 4.4.0 crashes #618

perrin4869 opened this issue May 5, 2020 · 12 comments · Fixed by #619
Labels

Comments

@perrin4869
Copy link
Contributor

perrin4869 commented May 5, 2020

What is the current behavior?

Running this module on node.js (for example during ssr) results in: ReferenceError: Element is not defined

What is the expected behavior?

Importing react-transition-group does not result in an error

The problem is this line:

nodeRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }),

A possible solution is: Element = typeof Element === 'undefined' ? function(){} : Element

@perrin4869 perrin4869 mentioned this issue May 5, 2020
@RetiFier
Copy link

RetiFier commented May 5, 2020

I too ran through the error exactly two hours ago. We tried getting rid of 'react-transition-group' LMAO!
Hope it serves as a temporary solution for ongoing development for me personally.
Cheerio!

@SaravananTamizhan
Copy link

@perrin4869 I do too. I tried commenting out the following code on '/node_modules/react-transition-group/cjs/Transition.js' in line 451.
VERY UNCONVENTIONAL WAY TO SOLVE A PROBLEM!
In case, you in need of any immediate solution, hope it works well for you too.
Would love to know more if a solution is up!

  nodeRef: _propTypes.default.shape({
    current: _propTypes.default.instanceOf(Element)
  }),

@oliviertassinari
Copy link
Contributor

oliviertassinari commented May 5, 2020

⚠️ The reference to Element changes between windows (popups, iframes). Prefer testing node.nodeType === 1.

@helloitsm3
Copy link

Having issues right now after updating my npm packages

@arrudaricardo
Copy link

Same problem here, using material-ui on nextjs:

ReferenceError: Element is not defined
    at Object.<anonymous> (/home/ric/code/anyway/node_modules/react-transition-group/cjs/Transition.js:452:44)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/ric/code/anyway/node_modules/react-transition-group/cjs/CSSTransition.js:14:42)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Module.require (internal/modules/cjs/loader.js:1074:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/ric/code/anyway/node_modules/react-transition-group/cjs/index.js:6:45)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)

@priteshpoddar
Copy link

Is this fixed?

@abdullah0786
Copy link

Is this fixed?

i dont think so because version is still 4.4.0.
#618

@furcan
Copy link

furcan commented May 6, 2020

+1

1 similar comment
@Krasnodaretc
Copy link

+1

@abdullah0786
Copy link

I too ran through the error exactly two hours ago. We tried getting rid of 'react-transition-group' LMAO!
Hope it serves as a temporary solution for ongoing development for me personally.
Cheerio!

make it 4.3.0 from 4.4.0 version

@deividcingolani
Copy link

deividcingolani commented May 6, 2020

+1 make it 4.3.0 from 4.4.0 version

@jquense
Copy link
Collaborator

jquense commented May 6, 2020

🎉 This issue has been resolved in version 4.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.