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.

Uncaught TypeError: __webpack_require__.n is not a function

See original GitHub issue

Bug report

What is the current behavior?

After updating from Webpack 5.24.4 to Webpack 5.25.0 and any newer version, I get the following error in the browsers dev tools:

runtime-bootstrap.js:39 Uncaught TypeError: __webpack_require__.n is not a function
    at eval (VM49083 errorReporting.ts:3)
    at Module../errorReporting.ts (error-reporting.js:40)
    at __webpack_require__ (runtime-bootstrap.js:36)
    at __webpack_exec__ (error-reporting.js:842)
    at error-reporting.js:843
    at webpackJsonpCallback (runtime-bootstrap.js:1199)
    at Array.forEach (<anonymous>)
    at runtime-bootstrap.js:1212
    at runtime-bootstrap.js:1214
    at runtime-bootstrap.js:1220

If the current behavior is a bug, please provide the steps to reproduce.

I’ve reduced the size of my app to an absolutely minimum and created a repo, which is available here: https://github.com/jens-duttke/webpack-bug-demo

What is the expected behavior?

Since I did no code changes with the Webpack update, I expect that the code works as it did in 5.24.4. I can’t see any breaking changes in the release notes of 5.25.0, which could cause this.

Other relevant information: webpack version: 5.25.0 up to 5.33.2 Node.js version: 15.8.0 Operating System: Windows 10 Pro Additional tools:

  • Babel 7 / babel-loader 8.2.2
  • TypeScript 4.2
  • React 17
  • Core-js 3.1
  • css-loader 5.2.1
  • mini-css-extract-plugin 1.4.1
  • html-webpack-plugin 5.3.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jens-duttkecommented, Apr 15, 2021

hm, multiple runtime chunks, you don’t need runtime-bootstrap.js chunk, I think it is bug

In my full app, I have different HTML pages and they use different runtimes. The runtime bundle runtime-bootstrap is loaded on all pages. The reason for this is to keep the runtimes as small as possible and only include what is really necessary on the respective pages.

0reactions
webpack-botcommented, Aug 1, 2021

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: __webpack_require__.i(...) is not a function
This error can arise if you try to import something from an existing npm package (in node_modules ) but the imported thing doesn't...
Read more >
Solving Uncaught TypeError: n is not a function
I found the root cause by backtracking the commits I made in Git. The error only happened in Production environment which led me...
Read more >
TypeError: require(...) is not a function in Node.js | bobbyhadz
To solve the "TypeError: require(...) is not a function", make sure to place a semicolon between your require call and an immediately invoked...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
Maybe there is a typo in the function name? Maybe the object you are calling the method on does not have this function?...
Read more >
react__webpack_imported_mod...
If you use react-redux 6.0.0, the following error may occur. Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_0_react___default.a.createContext is not a function ...
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