jQWidgets Forums
jQuery UI Widgets › Forums › Angular › Angular 6 Build Process
Tagged: Angular Build
This topic contains 3 replies, has 2 voices, and was last updated by Martin 6 years, 11 months ago.
-
AuthorAngular 6 Build Process Posts
-
Hello…
I ran into a few problems moving over to Angular 6.0.3 using JQWIDGETS 5.7.2. I hope the following makes sense, so you can check into the various problems I experienced.
Let me know if I can provide anything else.
I followed the documentation for using Angular CLI, and everything seemed to work until I tried to compile using script command “ng build.” The reason I did this was that I need to generate and “Public” library for access when I use Node. I kept getting the red error message “No NgModule metadata found for ‘AppModule.’” I found were you had documented this in the Angular CLI section the same error message. I also noticed that the instruction specifies that “ng serve” should be used to compile for the build.
I then ran “ng serve” and got the same error message, and then I followed instructions to edit the app-module.ts then save and rerun. This did allow build and server to run. However, that did not fix my problem because I needed to build the public library. It is my understanding “ng serve” compiles and puts results into memory. I can’t access with Node.
I also discovered after trial and error that just inputting an additional line in App-module.ts and saving caused “ng Server” to execute and everything was fine. However, if you stop the server and run the same “ng serve” command you get the same error.
Still, I have been unable to use “ng Build” to get the output of my compile to the public director for the NODE server.
To resolve I setup “ng serve” for a proxy API and linked my NODE server to an HTTP server on a different port. Worked because I’m running everything on my local machine.
I still do not have a solution for NG BUILD. No matter what I tried could not get past error using JQWIDGET modules.
Also, everything works using standard components without any JQWIDGET modules in use. Again, loss for why.I researched the web and found several hits were the same error message was encountered. I followed instructions on what worked for some people but had no luck with uninstalling and reinstalling Angular/cli and deleting node directory and doing an npm install.
Following Error Message with “ng Build”
Date: 2018-06-03T22:05:34.435Z
Hash: dd2381475980e936571a
Time: 5173ms
chunk {main} main.js, main.js.map (main) 633 bytes [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 688 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 471 kB [initial] [rendered]
ERROR in No NgModule metadata found for ‘AppModule’.Environment being used:
Angular CLI: 6.0.7
Node: 10.1.0
OS: win32 x64
Angular: 6.0.3
… animations, common, compiler, compiler-cli, core, forms
… http, language-service, platform-browser
… platform-browser-dynamic, router
Package Version
———————————————————–
@angular-devkit/architect 0.6.7
@angular-devkit/build-angular 0.6.7
@angular-devkit/build-optimizer 0.6.7
@angular-devkit/core 0.6.7
@angular-devkit/schematics 0.6.7
@angular/cdk 6.2.0
@angular/cli 6.0.7
@angular/flex-layout 6.0.0-beta.15
@angular/material 6.2.0
@ngtools/webpack 6.0.7
@schematics/angular 0.6.7
@schematics/update 0.6.7
rxjs 6.2.0
typescript 2.7.2
webpack 4.8.3Hello Gary,
Thank you for the detailed explanation of the issue!
You can fix this by adding
"src/app/app.module.ts",
in the ‘files’ array in the tsconfig.json file.Please, note that you should put it before the other files of the widgets, like this:
"files": [ "src/app/app.module.ts", "node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxgrid.ts" ]
Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/Martin,
Thanks for such a quick response.
Adding the file made it work.
Is this a standard needed now using JQWIDGETS or just a workaround for now?
Gary
Hello Gary,
No problem! This is a workaround.
This issue came with the latest Angular 6 version.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.