(NodeJS, SPA) Validation message not showing on localhost target but IS showing in wappler preview

Wappler Version : 3.3.3
Operating System : W10

Expected behavior

What do you think should happen?

Validation error should show in form after submitting

Actual behavior

What actually happens?

Nothing shows. In console this error shows:

dmxAppConnect.js:7 Uncaught TypeError: dmx.validate.setErrorMessage is not a function
    at n._done (dmxAppConnect.js:7)
    at n.onload (dmxAppConnect.js:7)

See video:

How to reproduce

  1. Create form and add server connect action
  2. Set up validation in server connect action
  3. Test form in WAppler preview mode - should show validation error message
  4. Test form on localhost target (docker) - doesn’t show validation error message

Normally this happens when dmxValidator.js is not included.

@patrick Sorry still quite new to this, shouldn’t it be automatically included? And does the preview window of wappler then automatically include more things than stated in the code?

I believe I did fix it by including it by adding a data validation attribute, which then added the include code to my main layout

I’ll mark it as solved, thanks. Still curious about the above questions though!

@patrick To add: I think something broke while changing my project to SPA. I just had a similar issue where I had to include <script src="/dmxAppConnect/dmxBrowser/dmxBrowser.js" defer=""></script> again to be added to the main layout.

Maybe my user error while changing to SPA, but maybe something to fix in the process, thanks!

I assume you were editing the content page and it should then insert the includes in the main layout. Is the Layout page linked on the content page, select the App Properties to see if it is. Alternative you can check in the source code the comment tag, it should contain head-page="layouts/main".