Saturday, February 26, 2022

[SOLVED] ng serve hangs up forever at 92% while processing additional asset using copy-webpack-plugin (Android OS / termux)

Issue

I was trying to run a regular angular 10 web application using my android smartphone when i came across blocking issue while ng serving the application: the ng serve is hanging on copying assets showing: "92% process additional asset copy-webpack-plugin".

Is there a way to force ng serve into throwing an exception or whatever meaningful message so that i could be able to investigate further? ng serve hangs up forever at 92% while processing additional asset using copy-webpack-plugin (Android OS/termux). Below are the details and steps done so far:

angular version:

angular version

New application:

New application

Ng serve --verbose:

Ng serve --verbose


Solution

Got a workaround after digging deep into the ng serve capability: just got rid of the assets section in the angular.json file as follow: "assets": [], instead of "assets": [ "src/favicon.ico", "src/assets" ],

For some reason, the webpack plugin was unable to copy these two assets to the memory when ran under android/linux (although these two files exist in the file system). Will dig deep into this sometime, but for now this workaround will solve the problem.

UPDATE: turns out to be a matter of copying folders! for some reason copy-webpack-plugin is hanging when trying to copy an entire folder (src/assets for instance / or whatever folder). so the workaround would be to mention files by names instead and omitting whatever folder path in the asset section in the angular.json file. something like what's shown below would work like charm : "assets": [ "src/favicon.ico", "src/assets/vid.mp4", "src/assets_bis/data.dat ], Sound weird but i will no longer dig into this issue since what i've figured out so far has proven to be more than sufficient at this point.



Answered By - HoUβem
Answer Checked By - David Goodson (WPSolving Volunteer)