7.13 “_interopRequireDefault is not a function”

In addition to #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

  - utils.js:136

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

4 thoughts on “7.13 “_interopRequireDefault is not a function”

  1. This bug is NOT fixed (as evidenced by the many new issues being opened within the last few hours). It would appear that a LOT of dependencies are pulling in the latest versions of babel automatically which makes it difficult to even temporarily roll back to an earlier babel version (unless you commit a yarn.lock file). Don’t mean to complain–just trying to get the word out that there are still some serious issues unresolved.

  2. 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.