ChatGPT is largely basing it’s knowledge on older documentation/examples.
I’d highly recommend keeping it working with Web Methods since .jsw files are deprecated within the Wix ecosystem.
Web Methods aren’t simply exported functions as in the code shared. Here’s the documentation - webMethod() - and the code I shared earlier also wraps in Web Method as required to work within a .web.js file and make it accessible from the frontend