0

I am getting issue while publishing the project.

The below output generated while publishing

VWT.AIA.WebAPI -> D:\Dev\V2-master\app\src\WebAPI\bin\Release\net452\win7-x86\WebAPI.exe
grunt dist
[4mRunning "clean:dist" (clean) task[24m
[32m>> [39m1 path cleaned.

[4mRunning "useminPrepare:html" (useminPrepare) task[24m
Configuration changed for [36mconcat[39m, [36muglify[39m, [36mcssmin[39m

[4mRunning "ngtemplates:dist" (ngtemplates) task[24m
File [36m./target/usemin-temp/template.js[39m created.
Added [36m./target/usemin-temp/template.js[39m to [33m<!-- build:js scripts/aia.min.js -->[39m

[4mRunning "concat:generated" (concat) task[24m

[4mRunning "ngAnnotate:dist" (ngAnnotate) task[24m
Generating "target/usemin-temp/concat/scripts/aia.min.js" from: "target/usemin-temp/concat/scripts/aia.min.js"...[31mERROR[39m
[31m>> [39merror: couldn't process source due to parse error
[31m>> [39mUnexpected token (3713:132)
[33mWarning: Task "ngAnnotate:dist" failed. Use --force to continue.[39m

[31mAborted due to warnings.[39m
D:\Dev\master\app\src\WebAPI\WebAPI.csproj(108,5): Error MSB3073: The command "grunt dist" exited with code 3.
Harish Batchu
  • 19
  • 1
  • 3
  • Hi Harish, any update about this issue? Please check if my answer helps you handle the issue? If it helps, please do not forget to [accept it](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). And if not or you have any other concern, please feel free to let us know and we are willing to help you further:) – Mr Qian Oct 21 '20 at 02:04

1 Answers1

0

I think the issue is that the command on the pre-build event or post-build event of the WebAPI project is wrong.

Right-click on your WebApi project-->Properties-->Build Event and the command grunt dist are written there.

I am afraid that the js files of your project has something wrong. And according to the error message, the issue is here:

target/usemin-temp/concat/scripts/aia.min.js 

And you can try the following steps to troubleshoot the issue:

1) install the latest nodejs version 14.14.0.

2) run VS as Administrator

3) run this command:

npm uninstall grunt-ng-annotate --save-dev

npm install grunt-ng-annotate@0.10.0 --save-dev

4) check on that js file very carefully and make sure that there are no grammatical errors on that file. There is a similar issue.

Besides, check on your all html files, maybe there are some unclosed tags or extra tags on html files.

In addition, if it does not work, I suggest you could share your js file and your packages.json with us to locate the problem further.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41