When compiling UI locally data source refresh option stops working

Hi,

I’m doing UI customization in a version 10.1.3 and I’m facing an issue with the data source refresh.

If I don’t deploy any customization the option works and the data source refresh is triggered in the right moment but if i start a local UI with a project generated by the cmf cli the option is not triggered.

I did some investigation and found that the issue is that in the local instance this method “startAutoRefresh” in cmf-core-dashboards is returning false in this condition “moment.isDuration(this.fetchInterval)” which is doing this:

export function isDuration(obj) {

return obj instanceof Duration;

}

Since the Product is able to have this working am I missing something in the customization project to overcome this?

Thanks in advance.

Hi Ricardo,

Can you provide more details about what your customization is doing? Do you see a behaviour on an existing control, on a new custom control or an new UI Page?

Can you check the value being passed to the function. This function is from moment.js package - https://momentjs.com/docs/#/durations/is-a-duration/? Can you check the differences between value being passed?

Also, provide us the moment.js library version being used, when you compile the code.

Best regards,

João Moreira

Hi João,It would happen even if I’m only delivering LBOs for example.I see this behavior in a new UI Page for example. I just need to activate the data source refresh. Regarding the version of moment it is using 2.29.4.I did not notice anything special on the value being passed. If instead of doing “obj instanceof Duration;” we do the instanceof with constructors it does return true in both cases.Did this help?Best Regards,Ricardo Pereira

Hi Ricardo,

we had the same thing happen when deploying our own GUI customization.
What you need to do is to add the “moment” package to your tsconfig.json and angular.json like this:

tsconfig.json:

angular.json:

After that, delete the .angular folder in your HTML Project to clear the cache and build the package as normal.

All the best,
Maximilian


moved to new reply due to lack of text format support

Hi

@Maximilian just wanted to say a big thank you for your help on this thread! It’s great to see you sharing the current workaround for this dependency conflict issue.

As you correctly pointed out, the adjustments to tsconfig.json and angular.json are indeed the way to go for now. We’re actively working on a more robust, long-term solution that will involve isolating the lbos dependencies by packaging it as a tar.gz file. This should prevent these kinds of conflicts between lbos and custom HTML folders in the future.

We’ve already implemented this in version 11.2 and are in the process of bringing it to older MES versions (10.x and up).

Thanks again for your contribution and for keeping the community informed!

Best regards,

João Moreira

Thank you both for the inputs.Tested and now it is working.Best Regards,Ricardo Pereira