Issue with fdk pack

I’m faced with a weird issue with fdk pack.

During development, I generate an a static asset called app.js and it contains this line of code among other things.

"tags": ${Object.freeze("{{{jsonEncode (pushItem payloadData.ticket.tags actionParams.tag)}}}")}\n}`}

It works fine, as expected when I do an fdk run and test my changes locally.

However, after doing an fdk pack, in the same file, same line, it looks like this.

"tags": ${Object.freeze("")}\n}`}

fdk pack is responsible for gobbling up everything between the triple curlies and the triple curlies themselves.

Why does fdk pack have to meddle with my static assets?

This line of code is in app.js which runs in the custom iparams page. This is not a server-sde code. It is client-side, which runs on the browser.

Hi @arunrajkumar235 ,

With the new FDK, we introduced auto-injection of fresh-client by using {{{appclient}}}.
You can read more in the User Guide attached in the following post:

This looks like a side-effect of using {{{ }}} as a token for replacing the syntax.

For the time-being ,can you try using a different way of representing the object?

We will take this up as a bug and fix it in subsequent releases.

Thanks.

Hi @Asif , thanks for the detailed explanation.

My app has moved to the platform version 2.3 and I’m making use of {{{appclient}}}.

This looks like a side-effect of using {{{ }}} as a token for replacing the syntax.

I now understand that you’re trying to replace everything within triple curlies and if it doesn’t match, you replace the whole thing with an empty string.

For the time-being ,can you try using a different way of representing the object?

Unfortunately, I can’t replace it as I’m using the handlebars syntax and in this instance I NEED the triple curlies.

(post deleted by author)

Hi @Asif ,

I wrote a utility method that circumvents the replacement of triple curlies. This seems to work now.

const encloseTripleCurlies = (str) => {
  const openCurlies = ['{', '{', '{'];
  const closeCurlies = ['}', '}', '}'];

  return [...openCurlies, str, ...closeCurlies].join('');
};
1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.