"TypeError: __webpack_require__.e is not a function" when using import()
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x
)
- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Node v10.8.0
Npm v6.4.0
Angular CLI: 6.1.5
Node: 10.8.0
OS: win32 x64
Angular: 6.1.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.7.5
@angular-devkit/build-angular 0.7.5
@angular-devkit/build-optimizer 0.7.5
@angular-devkit/build-webpack 0.7.5
@angular-devkit/core 0.7.5
@angular-devkit/schematics 0.7.5
@angular/cli 6.1.5
@ngtools/webpack 6.1.5
@schematics/angular 0.7.5
@schematics/update 0.7.5
rxjs 6.3.1
typescript 2.7.2
webpack 4.9.2
Repro steps
- Clone this repo and install npm dependencies.
- Run
ng serve
, and wait until you see a compilation error. - Fix the typescript compilation error in app.component.ts (see comment in that file).
- Navigate to
localhost:4200
. - You will see the error in the browser console.
The log given by the failure
ERROR TypeError: __webpack_require__.e is not a function
at foo (foo.js:2)
at new AppComponent (app.component.ts:15)
at createClass (core.js:9299)
at createDirectiveInstance (core.js:9186)
at createViewNodes (core.js:10406)
at createRootView (core.js:10320)
at callWithDebugContext (core.js:11351)
at Object.debugCreateRootView [as createRootView] (core.js:10838)
at ComponentFactory_.push../node_modules/@angular/core/fesm5/core.js.ComponentFactory_.create (core.js:8666)
at ComponentFactoryBoundToModule.push../node_modules/@angular/core/fesm5/core.js.ComponentFactoryBoundToModule.create (core.js:3315)
Desired functionality
The app should run with no errors.
Mention any other details that might be useful
The missing function __webpack_require__.e
should be located in the webpack-generated file runtime.js
, but in this case it is not there.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Uncaught TypeError: __webpack_require__.e is not a function
Looks like the issue is sticking with package webpack-target-webextension itself. I quickly checked its repo and apparently there's an ...
Read more >__webpack_require__ is not a function - You.com | The ...
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 >TypeError: require(...) is not a function in Node.js | bobbyhadz
Calling the result of require() when the imported file doesn't have a default export of a function. Having cyclic dependencies (imports and exports...
Read more >Module Federation - webpack
It's not possible to use a remote module without a chunk loading operation. ... an import() call, but older constructs like require.ensure or...
Read more >How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just had this problem. In my situation, i had imported a lazy-loaded module inside
AppModule
. So it was both assigned toloadChildren
in route definition as well as imported onAppModule
. The solution was just to remove the import of the lazy-loaded module onAppModule
Let’s close the issue for now, since there seem to be a solution pointed out by @theNotoriousHxc. Please open a new ticket if this is still relevant.