Skip to content

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

@RareSecond

Description

@RareSecond

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions