Dmx.parse() is only working when it is inside a JS function

Wappler Version : 3.4.2
Operating System : Win10, NodeJS / Docker project

Expected behavior

Firstly, i’m not sure if this is SUPPOSED to work this way, but i would have thought it should.

When you use dmx.parse() NOT IN a function it would work normally, such as setting a var value.

var test = dmx.parse('local.data.showTeams'); 

Actual behavior

When you use this in a custom JS file (loaded through script tags) you get this error:

parser.js:390 TypeError: Cannot read property 'get' of undefined
    at t (parser.js:655)
    at parser.js:741
    at parser.js:741
    at parser.js:455
    at Object.dmx.parse (parser.js:388)
    at schedule.js:2 // this is the custom JS file loaded in script tags

If it is used inside of a function and the function is called, then it works fine i.e.

function showTeams() {
    calendar.setOption('resourceGroupField', dmx.parse('local.data.showTeams'))
}

Also, the dmx.global.set() works FINE outside of a function like this example:

dmx.global.set('test', true);

How to reproduce

Community Page
Last updated: