[Bug report] Backend modules not working

Hello everyone,

I am trying to use a backend module.

This is my backend code (testmodule.jsw). The permissions of the test function is set to ‘Anyone’:

export function test(){
 return 'test'

This is my frontend code:

import {test} from 'backend/testmodule'

    console.log(res) //should print 'test'

This code works perfectly in preview, but in the published version it gives me this error:
There was an error in your script app.js:25:17658
TypeError: e.test is not a function

This code used to work but it broke after I changed nothing. I presume this is a Wix bug.

Any ideas as to what might be wrong would be greatly appreciated.

Edit: The code got fixed on its own, I didn’t change it at all. I hope this problem will not arise again.

We have seen this before. Try to add a couple of hard returns above the import, then Publish again.

Could you clarify what you mean by hard returns above the import?

Just a couple of “enter”'s to move it down a bit. And a couple below them. I know it sounds strange, but this is usually a solution.

Unfortunately that doesn’t seem to work… Are there any other possible solutions?

I am having the same error on my site, on my Members/Profile Update page. It was working perfectly then It started to give me this “e.Test is not a function”

I have no idea what is causing it. It did seem to possibly be related to a checkbox group. So I thought I would open one of my backups before the received the error. But now they are all producing the same error. I even duplicated my site, then moved it to Editor X and when I ran the Profile Update page I got the same error.

I talked to WIX support they have passed it on to the Advanced dev Team but I haven’t heard anything back since Thursday. Does anyone have any ideas?