I’ve been using runJS to trigger custom javascript functions ever since I started using Wappler a few years ago. Suddenly they stopped working so I created a simple page with a runJS pageflow to run a simple function and it errors out as well. Not sure if it’s a bug or not. I’ve tried the test page in both Wappler 6.0.0 beta-16 and Wappler 5.8.2 with same errors.
Here is the code for the test page.
<!doctype html>
<html>
<head>
<meta name="ac:route" content="/test">
<base href="/">
<script src="dmxAppConnect/dmxAppConnect.js"></script>
<meta charset="UTF-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="fontawesome6/css/all.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="bootstrap/5/css/bootstrap.min.css" />
<script src="js/jquery-3.4.1.slim.min.js"></script>
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="dmxAppConnect/dmxDropzone/dmxDropzone.css" />
<script src="dmxAppConnect/dmxDropzone/dmxDropzone.js" defer></script>
<script src="assets/js/top.js" defer></script>
</head>
<body is="dmx-app" id="test">
<script is="dmx-flow" id="flow1" type="text/dmx-flow" autorun="true">{
runJS: {function: "test", name: "test", outputType: "text"}
}</script>
<script src="bootstrap/5/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Here is the simple function that is in the top.js file.
function test() {
alert('working');
}
runJS throws the following error when run.
TypeError: window[e].apply is not a function
at n.runJS (dmxAppConnect.js:7:97153)
at n._execStep (dmxAppConnect.js:7:47020)
at dmxAppConnect.js:7:46449
My other scripts that I use to render a loading overlay throw a different error (below), but I have a feeling if I figure out why the simple one isn’t working, the more complex ones may possibly work again even though it’s a different error. I’ll worry about that after I figure out the simple one.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'apply')
at n.runJS (dmxAppConnect.js:7:97153)
at n._execStep (dmxAppConnect.js:7:47020)
at dmxAppConnect.js:7:46449
Hopefully it’s not something simple and stupid I’m doing haha.
Thanks in advance,
Twitch