Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Error with Angular Cli6 & Angular 6

Alellouche pro asked 6 years ago


I create à simple project with Angular6 & Angular Cli 6. I had:
  • "angular-bootstrap-md": "6.0.1" in package.json
  • "include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"] in tsconfig.json
  And when I start the project, I get: ERROR in No NgModule metadata found for 'AppModule'.  

Damian Gemza staff commented 6 years ago

Dear Alellouche, It's not a problem caused by our angular-bootstrap-md package. It's a CLI / Webpack problem. As JinsPeter said here: https://github.com/angular/angular-cli/issues/8798  you have to do following steps: npm remove webpack npm install --save-dev @angular/cli@latest If above steps won't work for you, please do also: npm cache clean --force npm install npm install --save-dev @angular/cli@latest Please let me know if those steps solve your problem. Best Regards, Damian

Alellouche pro commented 6 years ago

Sorry but my case is different, I didn't do any upgrade, I make a simple project from scratch. My steps: - ng new testproject - I add “angular-bootstrap-md”: “6.0.2” in package.json - I put “include”: [“node_modules/angular-bootstrap-md/**/*.ts”, “src/**/*.ts”] in tsconfig.json - npm start and boom, I get my error... Like I say, I test angular 6 and Angular 6, so your exemple steps doesn't work now... The import "include": ["node_modules/angular-bootstrap-md/**/*.ts" is doing this... :(

Damian Gemza staff commented 6 years ago

Dear Alellouche, Did you followed every step from our 5min-quickstart guide closely? https://mdbootstrap.com/getting-started/5min-quickstart/ I've followed your's steps, and for me, everything is working just fine. Please provide me every command which you're using to reproduce your error, or send me a project without node_modules at my email: d.gemza@mdbootstrap.com Best Regards, Damian

Alellouche pro commented 6 years ago

Some differents with you quick start, I am using Angular Cli 6. I am using npm v6 too. Ok I send you my project tonight.

keith.abramo free commented 6 years ago

I can confirm this is an angular-bootstrap-md issue. I just went through this upgrade and assumed my issue was with angular-cli / webpack. I went through all the steps of clearing and reinstalling. Still was getting this issue. I ran "npm uninstall angular-bootstrap-md" , removed references to this package in my project and, like magic, my project compiled without issue. I did "npm install angular-bootstrap-md" to re-add this package, I still left all other references of it out of my project and I got this same error again. This IS an angular-bootstrap-md 6.0.2 issue without a doubt.

Damian Gemza staff commented 6 years ago

Dear keith.abramo, Could you provide reproduction steps or send me your project without node_modules directory at d.gemza@mdbootstrap.com ?

rgomez free answered 6 years ago


Hi Damian,I've had problems with the Template installation (v.6.0.2, last commit), when I've done npm i, I have some problems like:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:UsersadmgomezDesktopTEMPLATE COPYng-admin-pronode_modulesnode-gyplibconfigure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:UsersadmgomezDesktopTEMPLATE COPYng-admin-pronode_modulesnode-gyplibconfigure.js:508:16)
gyp ERR! stack at C:UsersadmgomezDesktopTEMPLATE COPYng-admin-pronode_modulesgraceful-fspolyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:165:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\admgomez\Desktop\TEMPLATE COPY\ng-admin-pro\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags="
"--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:UsersadmgomezDesktopTEMPLATE COPYng-admin-pronode_modulesnode-sass
gyp ERR! node -v v10.1.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

The MDBootstrap team is aware that it is not working correctly?
When do you think a stable version will be available?**

thank you very much!,

Regards.


Damian Gemza staff commented 6 years ago

Try to install Python. That's not ng-admin-pro problems, but with your local environment. Best Regards, Damian

rgomez free answered 6 years ago


Hi Damian, I’ve done this: npm install –save rxjs-compat@^6.0.0 But I have the same error: ERROR in node_modules/angular-bootstrap-md/dropdown/dropdown.directive.ts(158,9): error TS2339: Property ‘filter’ does not exist on type ‘EventEmitter’. i 「wdm」: Failed to compile.

Damian Gemza staff commented 6 years ago

Please open node_modules/angular-bootstrap-md/dropdown/dropdown.directive.ts file and search for block which starts with this._subscription.push(this._state - line 158, and change this whole block of code with code from below: this._subscriptions.push(this._state .isDisabledChange // .filter((value: boolean) => value === true) .subscribe((element) => { if (element === true) { this.hide(); } })); Best Regards, Damian

rgomez free commented 6 years ago

Thank you very much Damian, is working for me.

jmchaves free commented 6 years ago

is it solucion temporally? This library supports rxjs 6.0.1?

Damian Gemza staff commented 6 years ago

Dear jmchaves, it's not temporally solution. This fix will be published with next release. Also with next release, our library will be fully compatible with RX6 and Angular 6. Best Regards, Damian

rgomez free answered 6 years ago


Hi i upgrade the angular-cli 5 to 6, but i has the same problem:

ERROR in No NgModule metadata found for 'AppModule'.
i 「wdm」: Failed to compile.

I've change in tsconfig.json:  "include": ["node_modules/angular-bootstrap-md/**/*.ts", "src/**/*.ts"]

to "include": ["src/**/*.ts","node_modules/angular-bootstrap-md/**/*.ts" ]
And now i have this error:
ERROR in node_modules/angular-bootstrap-md/dropdown/dropdown.directive.ts(158,9): error TS2339: Property 'filter' does not exist on type 'EventEmitter<boolean>'.
i 「wdm」: Failed to compile.
Could you help me please?


Damian Gemza staff commented 6 years ago

Dear rgomez, Please do npm install rxjs-compat@^6.0.0 --save Best Regards, Damian

Bahri Gungor free answered 6 years ago


Try rearranging the include so that "src/**/*.ts" is first in the tsconfig.json.

"include": ["src/**/*.ts","node_modules/angular-bootstrap-md/**/*.ts" ],

It now compiles without error for me.  I have spent *days* on this.


Alellouche pro commented 6 years ago

I confirm that is working for me too ! But why we have to do this? Can't you "fixe" your api that we don't have to modify the include section ??

Damian Gemza staff commented 6 years ago

This line won't be necessary in the next release of MDB Angular. Best Regards, Damian

Bahri Gungor free commented 6 years ago

I presume, Damian, that you mean you are packaging your library so we don't have to have the TS source? That would be great, to avoid TS upgrade issues in the future.

Damian Gemza staff commented 6 years ago

Bahri, Yes, with next release of MDB Angular our library will be packaged to .js, so users will get .js instead of .ts code! Best Regards, Damian

Bahri Gungor free answered 6 years ago


Issue solved.  See below.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags