OOTB Widget - Missing name in function declaration

MBarrott
Mega Sage

I want to make some customizations to the My Request (v2) widget but opening it for review and prior to cloning I can see it has an error out of the box.

 

Has anyone else experienced this and have a workaround? I'm unable to save with this error present.  

 

MBarrott_0-1720799609276.png

 

1 ACCEPTED SOLUTION

Isaac Vicentini
Mega Sage
Mega Sage

Hi @MBarrott,

 

This is just a warning message, it will not affect your development.

You'll be able to perform the clone without worry, but if you want to eliminate this message, you can rewrite the first line as:

 

api.controller=function($scope, spAriaUtil, i18n, spModal) {

 


 

If my answer helped you in any way, please mark it as correct/helpful 🙂

Regards,

Isaac Vicentini.

 




Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

View solution in original post

2 REPLIES 2

Isaac Vicentini
Mega Sage
Mega Sage

Hi @MBarrott,

 

This is just a warning message, it will not affect your development.

You'll be able to perform the clone without worry, but if you want to eliminate this message, you can rewrite the first line as:

 

api.controller=function($scope, spAriaUtil, i18n, spModal) {

 


 

If my answer helped you in any way, please mark it as correct/helpful 🙂

Regards,

Isaac Vicentini.

 




Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

Community Alums
Not applicable

Hi @Arun91 ,

Please refer this below links 

https://www.servicenow.com/community/developer-forum/widget-clone-could-not-save-record-because-of-a...

https://www.servicenow.com/community/developer-forum/service-portal-widget-client-script-quot-missin...

You can edit this by given below line 

 

api.controller=function($scope, spUtil, $uibModal, $location, $timeout, spModal) {

 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 
Sarthak