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

Uncaught TypeError: Cannot read property 'expirationTime' of undefined #14767

Closed
JDansercoer opened this Issue Feb 6, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@JDansercoer
Copy link

JDansercoer commented Feb 6, 2019

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

App crashes

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

This is currently my only component, copied from the docs

import React, { useState, useEffect } from 'react';

function Example() {
  const [count, setCount] = useState(0);

  // Similar to componentDidMount and componentDidUpdate:
  useEffect(() => {
    // Update the document title using the browser API
    document.title = `You clicked ${count} times`;
  });

  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>Click me</button>
    </div>
  );
}

export default Example;

However, my page crashes, and I get the following error

Uncaught TypeError: Cannot read property 'expirationTime' of undefined
    at processUpdateQueue (react-dom.development.js:15860)
    at mountClassInstance (react-dom.development.js:11353)
    at mountIndeterminateComponent (react-dom.development.js:14701)
    at beginWork (react-dom.development.js:15194)
    at performUnitOfWork (react-dom.development.js:18780)
    at workLoop (react-dom.development.js:18820)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
    at invokeGuardedCallback (react-dom.development.js:256)
    at replayUnitOfWork (react-dom.development.js:18052)

Unfortunately, I cannot reproduce it in codesandbox, so not sure what exactly I might be doing wrong?

What is the expected behavior?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
16.8.0 (React & ReactDOM)

@bvaughn

This comment has been minimized.

Copy link
Contributor

bvaughn commented Feb 6, 2019

I am also not able to reproduce this in Code Sandbox nor in a create-react-app, so I suspect your package versions maybe aren't what you think they are? Can you delete node_modules and re-install?

@bvaughn

This comment has been minimized.

Copy link
Contributor

bvaughn commented Feb 6, 2019

I am going to close this issue for now since I'm unable to reproduce it. I'll re-open if further discussion provides a repro 👍

@bvaughn bvaughn closed this Feb 6, 2019

@JDansercoer

This comment has been minimized.

Copy link
Author

JDansercoer commented Feb 6, 2019

Yes, was about to close this as well, since I found the issue.

For further reference or people stumbling upon this, update your react-hot-loader.

Version 4.3.6 wasn't too fond of hooks apparently!

@ha404

This comment has been minimized.

Copy link
Contributor

ha404 commented Mar 26, 2019

Apparently react-hot-loader's broken up to 4.5.2 as well, 4.8 worked 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.