ng2-smart-table icon indicating copy to clipboard operation
ng2-smart-table copied to clipboard

Ng2SmartTableModule is not an NgModule : error in angular-cli

Open bongiova61 opened this issue 8 years ago • 16 comments

Trying to use ng2-smart-table in angular-cli 1.0.0-beta.24 this error id displayed when starting the app. I'm need to use at least beta.24 due to requirements of other packages. Any scheduling for solving this problem?

bongiova61 avatar Jan 13 '17 08:01 bongiova61

Same Problem Here . Angular CLI beta 1.0.0-beta.24

by building my project with ng build --aot I became the following:

ERROR in Unexpected value 'Ng2SmartTableModule in ../node_modules/ng2-smart-table/build/src/ng2-smart-table.module.d.ts' imported by the module 'AppModule in ../src/app/app.module.ts'

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '../src' @ ./src/main.ts 5:0-74 @ multi main

ERROR in .//@angular/core/src/linker/system_js_ng_module_factory_loader.js Module not found: Error: Can't resolve '..../src/$$_gendir' in '../node_modules/@angular/core/src/linker' @ .//@angular/core/src/linker/system_js_ng_module_factory_loader.js 69:15-36 85:15-102 @ .//@angular/core/src/linker.js @ .//@angular/core/src/core.js @ .//@angular/core/index.js @ ./src/main.ts @ multi main

gianpo86 avatar Jan 13 '17 09:01 gianpo86

same problem here. ng build --aot, it build fails:

`ERROR in Unexpected value 'Ng2SmartTableModule in /Applications/MAMP/htdocs/Repo/Angular2/ng2-smart-table-proj/node_modules/ng2-smart-table/build/src/ng2-smart-table.module.d.ts' imported by the module 'TableModule in /Applications/MAMP/htdocs/Repo/Angular2/ng2-smart-table-proj/src/app/feature/table/table.module.ts'

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Applications/MAMP/htdocs/Repo/Angular2/ng2-smart-table-proj/src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts

ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js Module not found: Error: Can't resolve '/Applications/MAMP/htdocs/Repo/Angular2/ng2-smart-table-proj/src/$$_gendir' in '/Applications/MAMP/htdocs/Repo/Angular2/ng2-smart-table-proj/node_modules/@angular/core/src/linker' @ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 71:15-36 87:15-102 @ ./~/@angular/core/src/linker.js @ ./~/@angular/core/src/core.js @ ./~/@angular/core/index.js @ ./src/main.ts @ multi ./src/main.ts`

lx1036 avatar Jan 23 '17 14:01 lx1036

I also have the same problem and I'm with angular-cli: 1.0.0-beta.26.

ERROR in Ng2SmartTableModule is not an NgModule

jmcsoberano avatar Jan 23 '17 21:01 jmcsoberano

@jmcsoberano Yeah, my angular-cli version is also 1.0.0-beta.26 I cannot find answer from the google. Who has found the answer?

lx1036 avatar Jan 25 '17 07:01 lx1036

I had same issue. I tried to install ng2-smart-tables through package.json and start npm install. After ng serve I got this error message. Solution was that I installed it manualy with npm install --save ng2-smart-table, but previously deleted ng2-smart-tables folder from node_modules that I got earlier. This worked for me, angular-cli version is 1.0.0-beta.26.

milospop avatar Jan 27 '17 09:01 milospop

sudo npm install ng2-smart-table@latest --save, it install "ng2-smart-table": "^0.5.1-0" in package.json, and it is right now. Maybe it fix the bug in this version. My angular-cli version is also 1.0.0-beta.26.

lx1036 avatar Jan 27 '17 10:01 lx1036

Hello, I've been getting @klavs1us 's error over and over. But then I've downloaded their demo, built it for prod with aot = true and it ran successfully. I opened the package.json and i saw that they use 1.2.2 version of smart-table. You should just delete your old smart table + folder in node modules and copy this one "ng2-smart-table": "1.2.2" into your package.json and run npm install my angular-cli version is "^1.7.2" but I didn't changed it I hope I can help someone, cause I lost my entire day, I dont want to waste yours.

AlexMihov96 avatar May 27 '18 20:05 AlexMihov96

Thanks @AlexMihov96 it helps me a lots.

luzusomuch avatar May 31 '18 10:05 luzusomuch

Do you have any ideas on how to fix it in Angular 6?

sergot avatar Jun 06 '18 19:06 sergot

Hello, have you tried to lower the version of the ng2-smart-table package ?

AlexMihov96 avatar Jun 06 '18 22:06 AlexMihov96

I tried with 1.3.0 and 1.2.2 but still shows "Unexpected value 'Ng2SmartTableModule in .." when I execute ng build --prod --env=prod

any ideas or solution? I'm using angular 5

geremora avatar Jun 06 '18 23:06 geremora

@geremora try using the same angular-cli package as mine, and run ng build --prod only

AlexMihov96 avatar Jun 07 '18 07:06 AlexMihov96

I am getting error like ERROR in src/app/app.module.ts(4,37): error TS2307: Cannot find module 'ng2-smart-table'.

i done 1.npm install --save ng2-smart-table 2.npm i rxjs-compat --save 3.npm i ng2-completer –save

Still i am getting error.

nagipogu avatar Feb 04 '19 13:02 nagipogu

I'm using angular 8.2.5, I solved with rxjs-compat and ng2-completer.

Kappyh avatar Sep 20 '19 18:09 Kappyh

@Kappyh PLs share your angular version /angular cli version, also share the version of rxjs and ng2 completer..It would be helpful for us

rohitsrajput04 avatar Jul 01 '22 13:07 rohitsrajput04

@Kappyh PLs share your angular version /angular cli version, also share the version of rxjs and ng2 completer..It would be helpful for us

Sorry, I'm not currently working in this project since 2020.

Kappyh avatar Jul 04 '22 12:07 Kappyh