Skip to content

"TypeError: __webpack_require__.e is not a function" when using import() #12062

@timstoddard

Description

@timstoddard

Bug 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

  1. Clone this repo and install npm dependencies.
  2. Run ng serve, and wait until you see a compilation error.
  3. Fix the typescript compilation error in app.component.ts (see comment in that file).
  4. Navigate to localhost:4200.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions