ReferenceError: __TECTONIC__$servicenow_now_template_card is not defined

Tommy Jensen
Giga Guru

I have installed "@servicenow/now-template-card"

Imported it to my component.

Locally the card displays what I expect.

 

When deployed to the instanse I get following error (and nothing is displayed):

An unknown loading error occurred in /uxjs/test-comaround.jsdbx
 ReferenceError: __TECTONIC__$servicenow_now_template_card is not defined
    at Object.<anonymous> (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at r (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at Object.<anonymous> (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at r (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at Object.<anonymous> (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at r (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at Object.<anonymous> (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at r (ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6)
    at ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6
    at ac2f3d52f1e5916970db97471ada63ef.jsdbx?sysparm_substitute=false:6

 

 The same happens when using: @servicenow/now-card

1 ACCEPTED SOLUTION

Tommy Jensen
Giga Guru

Finally I figured out what the problem is.

 

Inner components must be updated with any subcomponents used in the project. Thing is I thought I had done that already several times.

In my custom component I use these NOW components: now-button, now-heading, now-loader, now-card and now-template-card so in now-ui.json the inner component array looked like this. But I kept getting the error. 

"innerComponents": [
				"now-button",
				"now-heading",
				"now-loader",
				"now-card",
				"now-template-card"
			],

 

It turns out that if any of those components use more components they have to be included so I looked in node_modules to find the extra components required for now-template-card and after modifying the inner components array to

"innerComponents": [
				"now-button",
				"now-heading",
				"now-loader",
				"now-card",
				"now-template-card",
				"now-template-card-attachment",
				"now-template-card-omnichannel"
			],

 

The components WORKS in servicenow agent workspacealso 🙂 now I just need to get the ribbon to work also.

find_real_file.png

View solution in original post

7 REPLIES 7

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,


Check if this UI script or style sheet is present in your instance or not /uxjs/test-comaround.jsdbx 

Thanks,
Ashutosh

That is not the problem.

 

Please note this relates to Now Experience components !

Tommy Jensen
Giga Guru

@Brad Tilton do you have some dev contacts you can ask about this? Its kind of blocking me from using these components.

Hi,

can you raise a HI ticket for this?


Thanks,
Ashutosh