7.13 "_interopRequireDefault is not a function"

See original GitHub issue

In addition to https://github.com/babel/babel/issues/12851

If you set resolutions for @babel/core to ~7.12.0 you then get this error:

   8 | exports.navigateTo = exports.replace = exports.push = exports.navigate = exports.default = void 0;
   9 |
> 10 | var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
     | ^
  11 |
  12 | var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
  13 |


  WebpackError: TypeError: _interopRequireDefault is not a function

  - index.js:10
    node_modules/gatsby-link/index.js:10:1

  - utils.js:136
    node_modules/@reach/router/lib/utils.js:136:1

gatsby-link requires babel/runtime/helpers/interopRequireDefault which seems to no longer exist in @babel/runtime@7.13

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:28 (13 by maintainers)

github_iconTop GitHub Comments

8reactions
nicolo-ribaudocommented, Feb 23, 2021

Yes, I’ll start working on this in 10 mins

5reactions
nicolo-ribaudocommented, Feb 24, 2021

Oh I think that the reason was that one of your dependency was using @babel/runtime@7.13.0 as a dependency, and by explicitly installing it you forced npm to update it. You can probably remove @babel/runtime from your deps now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix TypeError _interopRequireDefault is not a function ...
I'm trying to use Create React App on Codesandbox.io but I keep receiving TypeError _interopRequireDefault is not a function import ReactDOM ...
Read more >
Issue creating new project - RedwoodJS Community
TypeError : _interopRequireDefault is not a function . ... I don't have a interopRequireDefault.js; instead it's a directory with two files:
Read more >
babel/plugin-transform-runtime
A plugin that enables the re-use of Babel's injected helper code to save on codesize.
Read more >
@babel/runtime - npm
babel's modular runtime helpers. Latest version: 7.20.7, last published: 3 days ago. Start using @babel/runtime in your project by running ...
Read more >
How to fix TypeError _interopRequireDefault is not a function ...
Coding example for the question How to fix TypeError _interopRequireDefault is not a function in Create React App-Reactjs.
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