Red error popup in codeless editor in UI Builder

When working on on-click handler codeless logic, I’m getting a red error popup in UI-Builder:

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

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

It’s on page “recipes-detail”, on-click handler for “Icon5-2-2”. Any activity in the codeless block editor leads to the red error popup.

Please help.

Regards,

Found the error!
I have a syntax problem in my JS custom code block!

I had this issue several times now and I found the reason. In the custom code block, I’m defining a string like 'foo: \n' to contain the newline character ‘\n’. What your code editor doing, is to actually execute this newline to introduce a line break into the code which leads to the unexpected syntax error.

This happens after having saved the custom code successfully. Therefore, it is not obvious where the resulting error comes from …

Can you fix this to allow me to use \n in my strings in custom code?

Regards

One more finding. The replacement of my \n with a real line break in the editor happens after a copy and paste operation of a codeless block!

Hi, @Klaas_Klever

For sure, I just created an inernal ticket to fix the issue - BKNDLSS-27844.

Regards, Marina

Hello @Klaas_Klever

Can you please create some examples of this problem and show me? Everything works fine for me, I can’t repeat this problem.

Regards,
Viktor

Hi @viktor.liablin ,
I’ve created an example for you to see what happens:

  1. In my app 5BDF0E64-9F03-6F8E-FF75-0E183AF61100, go to page “landing”
  2. Open the on-click handler of the button “Press this”. Open the custom code
  3. You will see this:
    let string = 'This is a string with a 
    newline control character';
    console.log( string );
    
    This is invalid code. You cannot save it!
  4. Change this code to:
    let string = 'This is a string with a \n newline control character';
    console.log( string );
    
  5. “Save and Close” the code
  6. Go to the “USER INTERFACE” tab
  7. Go back to the on-click handler and check the custom code. It shows again the erroneous version. Obviously, the \n has been “executed”.

Regards,

@Klaas_Klever
Thx. Now I see.
We will try to fix it.
The workaround is to use `` instead of ‘’ if you want to use line break (\n)

Regards

Hi, @Klaas_Klever

We updated cloud servers with a fix for the issue you described above. Could you kindly let us know whether fix works for you well?

Regards, Marina

Hi @Marina.Kan
Works perfectly now
Thanks