Lots of DOM exception errors

I have a website that is mostly created with velo-code. At some point I started to get DOM exception errors quite frequently.

In the browser console it looks like that:


r {originalError: DOMException: Failed to execute ‘importScripts’ on ‘WorkerGlobalScope’: The script at ‘https://bund…, url: ‘https://bundler.wix-code.com/1bac45d7-aaae-410e-8c…d-from-package-name=false&dependencies-token=3938’, message: "Failed to import user code script: Failed to execu…me=false&dependencies-token=3938’ failed to load.", name: ‘LoadUserCodeError’, stack: ‘LoadUserCodeError: Failed to import user code scri…-app/1.628.146/viewerScript.bundle.min.js:1:2257)’}


I believe it has to do with wix compiling my code. Why do I assume this?
When the error occurs then I add some irrelevant code (like ‘console.log(“some nonsense”);’ and publish the site again hoping that it works.
Usually I have to try and change this “nonsense”-line several times and at some point it works.
I also figured out that it might have to do with the fact that on the particular page that creates the error the code is very long (around 6000 lines).

It is very annoying to work with this. Any ideas how to fix it?

3 Likes

Try to remove/change any native JavaScript functions. I was using .toString() and removing it fixed this error for me.

Same here. Just started today, no issue yesterday.

Agree it seems like a compile issue. Site header works fine but body code not compiling properly.

Yet to find a consistent solution but sometimes refreshing the editor or editing my code then republishing temporarily works.

Any help gratefully received.

When I have the error I usually add a useless console.log(“like this”) and compile again. Mostly it works. I believe it has to do with the length of the overall code (my code on the page where the error mostly occurs has some 6000 lines).

I don’t think it’s a length thing. The page I’m having difficulty with at the moment has ~400 lines.

Interesting. Maybe it is a combination of sfs.enquires answer (native JS) and other issues.

Seems to be better now. Pretty disruptive when it happened though, would be keen to know how to avoid.

Same problem here. I did not make any modifications since yesterday, when the site worked fine. Every page has the same problem, even when deleting (commenting out) all the code.

The exact same thing happened on our site

The site was working fine, and in one moment the error started appearing on all pages and many actions were blocked. We haven’t found a solution for this yet.

I created a random empty site and page with only empty onReady function, and the problem still persists.

“DOMException: Failed to execute ‘importScripts’ on ‘WorkerGlobalScope’: The script at ‘https://bundle r . wix-code . com/1780ed4f-d41e-4a25-b8ae-3dd99eef0126/edb01bd9-5fc4-499e-9ab4-73663cdc1799/a108a202-1cd7-41c9-8023-823ce96c7641/pages/c1dmp.js?analyze-imported-namespaces=false&init-platform-api-provider=true&get-app-def-id-from-package-name=false&inject-elementory-support=true&dependencies-token=3938’ failed to load. at e.exports.importSync (https://static .parastorage. com/services/wix-code-viewer-app/1.1479.568/app.js:15:22872) at eval (https://static .parastorage. com/services/wix-code-viewer-app/1.1479.568/app.js:2:16825) at Object.eval [as traceSync] (https://static .parastorage. com/services/wix-code-viewer-app/1.1479.568/app.js:2:18863) at eval (https://static .parastorage. com/services/wix-code-viewer-app/1.1479.568/app.js:2:16760) at Array.reduce () at e.exports.fetchUserCode (https://static .parastorage. com/services/wix-code-viewer-app/1.1479.568/app.js:2:16725) at eval (https://static .parastorage. com/services/wix-code-viewer-app/1.1479.568/app.js:2:10582) at f (https://static .parastorage. com/services/chat-worker/1.1239.0/viewer-script.bundle.min.js:1:6687) at Generator.eval [as _invoke] (https://static .parastorage. com/services/chat-worker/1.1239.0/viewer-script.bundle.min.js:1:6475) at Generator.eval [as next] (https://static .parastorage. com/services/chat-worker/1.1239.0/viewer-script.bundle.min.js:1:7116)”

Check my comment 45min ago, seems to be site-wide problem.

Thanks :slight_smile:
We tried to add prints (console.log) in the global section and that solved the problem, but we still don’t know why it happened.

We would appreciate help on how to avoid this in the future.

By the way - this is a fairly short piece of code, a few tens of lines, it doesn’t seem to be related to the code length.

We had the same issue as well, but just refreshed and our sites seem to have come back online, seems to have been a wix-wide problem that’s fixed now (at least for our sites).

Thank you for this question. It saved a lot of time.

Hi,

Im now facing the same issue as described above. Tried all solutions mentioned but no luck. any magical solution found since 2022? :slight_smile: Or I guess it will go away the same way as it started to appear :woman_shrugging:

Same here.
I’ve reported about it and it seems like a problem with Wix.
You can track the issue here.