damienbod / AngularWebpackVisualStudio

Template for ASP.NET Core, Angular with Webpack and Visual Studio
https://damienbod.com/2016/06/12/asp-net-core-angular2-with-webpack-and-visual-studio/
MIT License
487 stars 128 forks source link

ngc Failing on using angular-2-data-table #59

Closed cvbc2010 closed 7 years ago

cvbc2010 commented 7 years ago

I am getting ths error while running ngc. I have stared where ever confidential. Please help me out in this.

cmd.exe /c npm run ngc --color=always

Dashboard@1.0.0 ngc C:\Users\bchirravurivenkat\Documents\\App*Web ngc -p ./tsconfig-aot.json Unexpected value 'DataTableModule in C:/Users/****/Documents/Dashboard/App/DashboardWeb/node_modules/angular-2-data-table/dist/index.d.ts' imported by the module 'DashboardModule in C:/Users/bchirravurivenkat/Documents//App//angular2App/app/modules/dashboard/dashboard.module.ts' npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "ngc" "--color=always" npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! code ELIFECYCLE npm ERR! DUWSFDashboard@1.0.0 ngc: ngc -p ./tsconfig-aot.json npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the Dashboard@1.0.0 ngc script 'ngc -p ./tsconfig-aot.json'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the Dashboard package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ngc -p ./tsconfig-aot.json npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs Dashboard npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls *****Dashboard npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\bchirravurivenkat\Documents*Dashboard\App*DashboardWeb\npm-debug.log

Process terminated with code 1.

Thanks, Bharani Chakravarthy.

robisim74 commented 7 years ago

Is angular2-data-table compatible with AoT compilation? Not all external libraries are ready for using it.

cvbc2010 commented 7 years ago

https://www.npmjs.com/package/angular2-data-table

Here he says, it supports AOT Compilation. In Features section.

robisim74 commented 7 years ago

You are using angular-2-data-table, and not angular2-data-table (now ngx-datatable). See the path of the error you are getting: C:/Users//Documents/Dashboard/App/DashboardWeb/node_modules/angular-2-data-table/dist/index.d.ts'

408796571 commented 7 years ago

@cvbc2010 I have the exact same issue when running ngc. Did you manage to figure out? @robisim74 Any tips on how we can make this angular-2-data-table work with AOT?

Thanks!

cvbc2010 commented 7 years ago

Now i want to switch to ngx-datatable. Instead of wasting time on solving the issue. Yesterday i wasted 5 hrs for trying to fix it.

robisim74 commented 7 years ago

@Mark-Brightcloud If you see the code of angular-2-data-table , it doesn't generate the ES2015 modules and the metadata files to work with AoT. You have to ask to its owner, or fork the project and create your own package with the changes. Greetings

damienbod commented 7 years ago

@robisim74 thanks @cvbc2010 @Mark-Brightcloud You should not use any libraries which don't support AoT, not good for users of your application. You could try creating an issue on the repos you are trying to us. I will also try to find a grid which supports AoT of fork the repos. Let me know if you find a good grid.

Angular has a problem here as many Angular library repos are not production ready.

Greetings Damien

408796571 commented 7 years ago

@robisim74 @damienbod Really appreciate your time and comment! Will do.

damienbod commented 7 years ago

@Mark-Brightcloud Is it ok to close this, as this is a problem with the npm package not supporting AoT.

cvbc2010 commented 7 years ago

Sorry i forgot to close this thread. Thanks.