Click Interaction Error?

Hi there,
I have a similar error as @hopscotch which is mentioned in the following post:

This error usually occurs when the ID is not toggeld when using interactions.
Although the ID and class are active, I get the click interaction error.

<h1 id="heading-cef957b" class="heading-ce3c01f" data-interaction='{"click":[{"action":"customjs","class":"","targets":[],"conditions":[],"customjs":"history.back();"}],"dbclick":[],"scrollinview":[],"clickTar":{"target":"current"}}'" data-cc-comp="component-c81b7fc">Test</h1>Test
Console
14:56:54.213 Uncaught TypeError: c is null
    cc_interactions http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    cc_interactions http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    <anonymous> http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    <anonymous> http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    EventListener.handleEvent* http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
cc-interactions.min.js:1:5875
    cc_interactions http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    forEach self-hosted:203
    cc_interactions http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    <anonym> http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    forEach self-hosted:203
    <anonym> http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1
    (Async: EventListener.handleEvent)
    <anonym> http://localhost/Websites/Bugtest/wp-content/plugins/cwicly/assets/js/cc-interactions.min.js?ver=1.3.1:1

I tried to reproduce this error on another setup and on the Cwicly demo site, but I could not replicate the error.
I packed a sample header into a component and exported it to a demo site where it worked.
grafik

When I exported several blocks, I could see the same error on the demo page.
But when editing, the error disappeared.
grafik

This is a site that was updated from 1.2.9.9.5 and now at version 1.3.1.

Is there any way I can check the error further?

Cheers

Hi @T-low,

The first thing to check is that there is an ID on the block that is the target of the interaction.

Hi @StrangeTech,
the thing is that I get this error message every time I try to set up an interaction on this website.

I tested with the custom function history.back() where I don’t need an ID if the target is set to “current”, right? :smiley:
And another one where I switched a class.

I tested both by packing them in components and testing them on a different site, where they worked fine. So this might not my problem? :thinking:

If the target is set to current, then you only need an ID on the current block, as the trigger block and the target block are the same. :+1:

So, it sounds like there may be another interaction somewhere (on the site that gives you the error) with a target that doesn’t have an ID.

If you have only used interactions on pages, then I recommend creating a new blank page and testing on that - if that works, then it’s probably in the page/s you are getting the errors.

If you have used interactions in templates, then I recommend looking at all of the templates that are shared between the pages you see the error on and check in them in case there is an interaction in there.

1 Like

I’m not sure where the error was in my CTA box, but it’s fixed now :+1:
The funny thing is that the error only appeared when I tried to add an interaction…
Well, who knows, I turned off all my fragments and woila, I was able to create the interaction on the page :tada:
I added each fragment one by one and when I activated the CTA box, the error popped up again.
Went through each block completely, but none had an interaction… So I deleted the template part and recreated it. Now there are no more errors on my page :+1:

Many thanks @StrangeTech for helping me with the debugging :heart:

1 Like