So when building the project or turning on concatenate scripts option on launch, I happend to get this sort of error. Saying Documents or pc is not defined on scripts. Strangely, that code do work no matter the error happens or not
since error happens nevertheless code is working or not, I think it is some issue happening when merging script to one file.
through the excluding scripts and adding “//” to scripts, I think I found the one causing problems.
when defining new Worker, it seems like build is failing.
when adding citation to all code using new Worker, building project seems to go without error.
What is the cause of this, and what is the way around this?
Hey @Deanies I’m not 100% but this could be an editor parsing issue, but I can’t really tell. Can you provide a simple test case that replicates the issue, and I can take a look on my end
Thank you all for answer. I think our team found what is the problem. We were getting script through file url, which was getting merged script url. So worker was registering whole script, not the file intended.
We could try to register txt rather than js, so script wont be merged, but I think that solution is not clean enough. Or Is there option to prevent script from being merged?
yep, so the worker script unfortunately gets concatenated into the main build. Something we should hopefully fix in the upcoming ES Module support. for now you probably want to use an inline worker