Custom widget not showing latest changes

0
Hi Mendix community,   I am working on a custom widget, and today I’m experiencing that the log/output messages and behavior of the widget does not change when I try and update the widget. What I am doing to update the widget: - Add new logger.debug or console.log calls to the custom widget.* - Change existing logger.debug calls in the custom widget.* - ‘Build Custom Widget’ in 3rd party program Brackets. - Copy the generated .mpk file from the /test/widgets/ directory of the custom widget into my Mendix project’s /widgets/ directory. - Right-click on the custom widget on one of the pages in my Mendix app and click ‘Update all widgets’* - Run the Mendix app locally and navigating to the page that uses the custom widget. - Check browser console and Mendix Studio Pro console to check for changed / new output messages.    * = this step I’ve tried sometimes, as it’s considered extra. I have also tried all the steps at once.   However, even after verifying that the changed timestamp on the generated .mpk file is showing correctly and that I am copying the file to the correct project directory, as well as clearing my browser cache, I still receive old output messages.   Here’s an example of one of the output messages – it only occurs once in the custom widget JavaScript code: // Old console.log("loading took", Date.now() - start, "ms"); // New console.log("testtt loading took", Date.now() - start, "ms"); When I visit the page with the custom widget, I receive “loading took 2951 ms” in my browser console.   Thanks a lot in advance, Andreas
asked
4 answers
1

Hi Andreas,

If you are still receiving the old messages it means the bundled files are not up-to-date inside the MPK. Have you ever tried our new shiny Pluggable Widgets?

https://docs.mendix.com/howto/extensibility/create-a-pluggable-widget-one

 

answered
0

Hello Diego,

I have tried reading the MPK contents – the JavaScript file within uses the new code.

I am hestitant to follow through with your suggestion about using your new Pluggable Widgets, as it appears that I will have to rewrite the entire widget in TypeScript, according to the link you sent. Thanks though.

answered
0

Hello Andreas, 

When building a pluggable widget, you can choose the programming language → JavaScript or TypeScript. Have you also tried to synchronise the project directory(F4) and debug the widget in the browser?

answered
0

Hello Johan,

Thank you for the information. Turns out I hadn’t cleared all of my browser cache, which was the culprit.

answered