question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.5.0-beta.1] __webpack_require__.$Refresh$.signature is not a function

See original GitHub issue

Version: @pmmmwh/react-refresh-webpack-plugin:0.5.0-beta.1 react-refresh:0.9.0 webpack: 5.21.2 react: 17.0.1

Issue does not occur with @pmmmwh/react-refresh-webpack-plugin:0.5.0-beta.0

Issue: When using a render prop with a useEffect in the render prop __webpack_require__.$Refresh$.signature is not a function is thrown.

Reproduction:

function FunctionRenderer({children}) {
  return children();
}

function TestComponent() {
  return (
    <FunctionRenderer>
      {() => {
        useEffect(() => {}, []);

        return <span>Hello</span>;
      }}
    </FunctionRenderer>
  );
}

Other Info: If the render prop is declared externally, this issue does not occur

const externalRenderProp = () => {
  useEffect(() => {}, []);

  return <span>Hello</span>;
};

function FunctionRenderer({children}) {
  return children();
}

function TestComponent() {
  return (
    <FunctionRenderer>
      {externalRenderProp}
    </FunctionRenderer>
  );
}

If the render prop does not contain a useEffect, this issue does not occur

function FunctionRenderer({children}) {
  return children();
}

function TestComponent() {
  return (
    <FunctionRenderer>
      {() => {
-        useEffect(() => {}, []);

        return <span>Hello</span>;
      }}
    </FunctionRenderer>
  );
}

If the useEffect is not in the render prop this issue does not occur

function FunctionRenderer({children}) {
  return children();
}

function TestComponent() {
+
+  useEffect(() => {}, []);
+
  return (
    <FunctionRenderer>
      {() => {
-        useEffect(() => {}, []);

        return <span>Hello</span>;
      }}
    </FunctionRenderer>
  );
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phaistoniancommented, Apr 25, 2021

@pmmmwh Thak you. ETA for a release with this fix?

0reactions
pmmmwhcommented, Apr 25, 2021

0.5.0-beta.4 have been released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pmmmwh/react-refresh-webpack-plugin v0.5.8 - npm.io
An EXPERIMENTAL Webpack plugin to enable "Fast Refresh" (also known as Hot Reloading) for React components. This plugin is not 100% stable. We're...
Read more >
React hydrate TypeError: __webpack_require__.i(...) is not a ...
I am getting a webpack TypeError when trying to ...
Read more >
Gatsby Changelog | 5.3.0
Welcome to gatsby@5.3.0 release (December 2022 #1). Key highlights of this release: ... Partial Hydration is in Beta and not enabled by default....
Read more >
Changelog - Cypress Documentation
Fixed an issue with Angular Component Testing where urls within SASS/SCSS files were not being correctly resolved which could result in incomplete styling....
Read more >
Changelog | Meteor API Docs
Updated github-oauth to use async functions. ... meteorjs/babel@7.16.1-beta.0 ... Update terser package due to security fixes and to take advantage of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found