ngx-bootstrap: UMD ES5 bundle does not contain constructor type info (regression of v3.0.0)

Bug description or feature request:

The file ngx-bootstrap.umd.js in version 3.0.0 does not contain type information for constructor parameters, leading to angular dependency injection failure:

Unhandled Promise rejection: Can’t resolve all parameters for … (depending on which service is being imported).

In version 2, UMD contains something like

    ComponentLoaderFactory = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Injectable"])(),
        __metadata("design:paramtypes", [typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ComponentFactoryResolver"] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ComponentFactoryResolver"]) === "function" && _a || Object, typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["NgZone"]) === "function" && _b || Object, typeof (_c = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injector"] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["Injector"]) === "function" && _c || Object, typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_2__positioning_index__["c" /* PositioningService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_2__positioning_index__["c" /* PositioningService */]) === "function" && _d || Object, typeof (_e = typeof __WEBPACK_IMPORTED_MODULE_0__angular_core__["ApplicationRef"] !== "undefined" && __WEBPACK_IMPORTED_MODULE_0__angular_core__["ApplicationRef"]) === "function" && _e || Object])
    ], ComponentLoaderFactory);

whereas in version 3, there is

    ComponentLoaderFactory = component_loader_factory_decorate([
        Object(core_["Injectable"])()
    ], ComponentLoaderFactory);

(no type information at all). Interestingly, ES2015 bundle contains type info.

Plunker/StackBlitz that reproduces the issue:

Plunkr: https://plnkr.co/edit/RZGIYxl0ASPJ6wIiHVtv

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 3.0.0

Angular: 6

Bootstrap: *

Build system: Angular CLI, System.js, webpack, starter seed:

System.js (umd module)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 31 (6 by maintainers)

Most upvoted comments

With angular-seed this makes ngx-bootstrap version 3 practically unusable. The last version working for me was 2.0.5. I’m pretty sure this is a problem for many people.

Yes, because angular-cli doesn’t use this particular UMD bundle. It is not a problem for me (I’m migrating the project to angular-cli anyway), but it may be problem for others who cannot do that for any reason.