Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Error when running on production env #17

Closed
freddygymlib opened this issue Jan 20, 2019 · 9 comments
Closed

Error when running on production env #17

freddygymlib opened this issue Jan 20, 2019 · 9 comments

Comments

@freddygymlib
Copy link

Hello,

running the example https://github.com/zeit/next.js/tree/master/examples/with-next-page-transitions on production env triggers an error:

TypeError: Cannot read property 'isRequired' of null
at Object. (/home/freddy/Workspace/workspace-projects/workspace-together/with-next-page-transitions/node_modules/next-page-transitions/lib/PageTransition.js:300:37)

Which refers to this: line 300 - PageTransition.js
timeout: _PropTypes.timeoutsShape.isRequired,

When looking from the origin of the problem, I found this line on the react-transition-group dependency

var timeoutsShape = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({ enter: _propTypes.default.number, exit: _propTypes.default.number }).isRequired]) : null;

Note: this problems does not appear on the 1.0.0-alpha.1 release because back then we had on PageTransition.js:

timeout: _PropTypes.timeoutsShape

Regards,

Freddy

@freddygymlib
Copy link
Author

Hello,

Becareful, I think there is a small typo in the pull request #18

code removed: loadingCallbackName: 'pageTransitionReadyToEnter',
new code: loadingCallbackName: 'pagessTransitionReadyToEnter',

Regards,

Freddy

@teleginzhenya
Copy link

@freddygymlib thanks will fix it, it is all about MacBook Pro 2017 keyboard :(

@nwalters512
Copy link
Member

Looks like this was caused by reactjs/react-transition-group#448. Will take a look at the PR!

@vincivince
Copy link

Hi all, any moves to deploy a fix ?
Thx

@ScottMorse
Copy link
Contributor

I made a pull request #21 using the fix I used most recently with an app I deployed. Right now I have to use my custom copy of the source in my project since the Node packages are installed and built remotely.

It allows for the timeout and loadingTimeout's prop types (the react-transition-group's custom timeoutsShape type) to still be required in development, but avoids these errors seen in production.

Let me know if it seems like the fix you are looking for.

@genox
Copy link

genox commented Jan 30, 2019

@ScottMorse thanks, gonna use your fork meanwhile 👍

@nwalters512
Copy link
Member

Resolved by the PR from @ScottMorse in #21 - I'll release a version containing the fix shortly.

@fr3fou
Copy link

fr3fou commented Feb 1, 2019

So can it now be used in production?

@ScottMorse
Copy link
Contributor

I am using it now in my Next app in production and it's working! https://www.pymusician.com

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

No branches or pull requests

7 participants