Failed to find exported name of node (class ButtonRadioGroupDirective ...)

Viewed 8880

I am following a course on Udemy (https://www.udemy.com/course/build-an-app-with-aspnet-core-and-angular-from-scratch), so far, so good, until I tried to install ngx-bootstrap .

I installed npm install ngx-bootstrap --save on an Angular9 project and on ng build I receive the following error:

Compiling ngx-bootstrap : es2015 as esm2015

ERROR in Failed to find exported name of node (class ButtonRadioGroupDirective {
    constructor(cdr) {
        this.cdr = cdr;
        this.onChange = Function.prototype;
        this.onTouched = Function.prototype;
    }
    get value() {
        return this._value;
    }
    set value(value) {
        this._value = value;
    }
    writeValue(value) {
        this._value = value;
        this.cdr.markForCheck();
    }
    registerOnChange(fn) {
        this.onChange = fn;
    }
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
}) in 'C:/Dev/DatingApp/DatingApp-SPA/node_modules/ngx-bootstrap/bundles/ngx-bootstrap.es2015.js'.

I was experiencing a previous issue, I was able to find a solution here: https://github.com/valor-software/ngx-bootstrap/issues/5242

Not sure if it is related, but will share just in case:

ERROR in The target entry-point "ngx-bootstrap" has missing dependencies:
 - @angular/forms/src/directives/control_value_accessor
 - @angular/core/src/type

Thank you for the help! and let me know if I should prove any additional information.

ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.3
Node: 12.16.1
OS: win32 x64

Angular: 9.0.2
... animations, common, compiler, compiler-cli, core
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@angular/cli                      9.0.3
@angular/forms                    9.0.5
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2
1 Answers

The solution to this problem is the version number of ngx-bootstrap in the packages.json file in the angular project.

"dependencies": {
     ...
     "ngx-bootstrap": "^5.5.0", // was "ngx-bootstrap": "^3.0.1",
    ...
},       

Setting ngx-bootstrap to the latest solved the issue.

Running both npm install and ng serve command are now running with no related errors and am able to proceed forward.

Related