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

Tommy Jensen
Giga Guru

I have published a very simple component on github that reproduces this error. 

Remember to update now-cli.json with your instanse details.

 

Here

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

Revanth7
Tera Contributor

i deployed a component successfully to my instance and tried to show using the glidemodal by creating an entry in "Registered scripting modals". Using the API from the registered scripting modal to open the component using UI action. I verified the component is working properly but not working with the glidemodal. Any idea how to make this work will help me.