Invalid generated coding in UI Builder

Application ID: 5BDF0E64-9F03-6F8E-FF75-0E183AF61100

Oops. An internal error [f6dd0df3919f946d38f631686d8b32a2] has occurred. We are working on it. Please try again later

Page “share-recipe”, On-Click event for Button “ButtonYes”:
In UI Builder, I’m getting this red popup
image
Console shows Uncaught SyntaxError: Invalid or unexpected token .

The generated code for this event routine looks corrupted:

define([], () => ({
  /* content */
  /* handler:onClick */
  async onClick(___arguments) {
    var error, receivers;


  try {
    await Backendless.Request.post(`${Backendless.appPath}/services/Share/unshareObject`).set('Content-Type', 'application/json').set((function(h){if(!h['user-token']){delete h['user-token']} return h})({ 'user-token': Backendless.getCurrentUserToken() })).send({ 'sharedObjectId': (___arguments.context.pageData['selectedRecipeId']),'receivers': ({ 'users': [(___arguments.context.pageData['selectedShareUser'])],'groups': [] }),'objectType': '01' });
    await BackendlessUI.Functions.Custom['fn_e725e19b37e5d646e5c74f2766247bda'](___arguments.context.pageData, (___arguments.context.pageData['selectedRecipeId']), '01')
    ___arguments.context.pageData['toUsers'] = (receivers['users']);

  } catch (error) {
    console.log(error);

  } finally {
    ;(function (componentUid, visible){ (function(component){ component.display = !!(typeof visible === 'boolean' ? visible : !component.display ) })(___arguments.context.getComponentByUid(componentUid)) })('861e29e4ea5a8352a9794a0d1f19388e', false);

  }

  },  
  /* handler:onClick */
  /* content */
}))
1f19388e', false);

  }

  },  
  /* handler:onClick */
  /* content */
}))

Can you please fix this?

Regards,

Hello @Klaas_Klever,

does this error still occurs? I wasn’t able to reproduce it, and ButtonYes onClick event doesn’t return any error.

Regards,
Olha

Hi @olhadanylova ,
The red box in UI Builder is gone.
I still get this error in Chrome Inspector when I refresh the page:
Uncaught SyntaxError: Invalid or unexpected token .

Chrome Inspector is showing me the above shown coding with this syntax error:

  /* handler:onClick */
  /* content */
}))
1f19388e', false);

  }

  },  
  /* handler:onClick */
  /* content */
}))

So consequence is tha tthe button is not working, but the syntax error is already detected by Chrome when you open the page.

I’ve created an internal ticket BKNDLSS-26007 for our UI Builder developer to investigate this issue.

Regards,
Olha

Hello @Klaas_Klever

Did you change/work with page’s files?

It looks like incorrect working with copy/paste

I’ve fixed it you can check

Regards,
Viktor

Hi @viktor.liablin
I didn’t change the generated coding! Would never do this, because it is not under my control.
I actually did a copy/paste before the error occurred. But I copied a Block from one event handler to another. It seems that indeed something went wrong when doing this Block copy/paste.

Now it’s working again.
Thanks