I’m testing the volume rendering feature by loading a .vti file inside the render window. The project is built with Vuejs Vite tools. When I test the app running yarn dev the volume is rendered correctly, but as soon as I build the project yarn build and upload the bundle files on my webserver I got the following errors.
vendor.a818eb0e.js:2109 Uncaught TypeError: Cannot read properties of undefined (reading 'search')
at I6 (vendor.a818eb0e.js:2109:37)
at W6 (vendor.a818eb0e.js:2111:29)
at new <anonymous> (vendor.a818eb0e.js:2111:167)
at Object.t.setDataArray (vendor.a818eb0e.js:2111:12031)
at Object.t.setupContent (vendor.a818eb0e.js:2247:735)
at Proxy.loadVolume (index.e79968b2.js:1:2746)
at FileReader.t.onload (index.e79968b2.js:1:3876)
Debugging the code I found that the app break at controllerWidget.setupContent(renderWindow, actor, isBackgroundDark);
Hi Forrest, Thank you for your reply. When I run the app in development mode using yarn dev command, it works properly.
How can I provide more info on the problem?
I am not sure where a property search is being requested, so I’m left guessing. Can you try to see what the prettified code (devtools can do this) looks like at I6 and W6? Or better yet, see what the 3rd line new <anonymous> is doing. I’ve followed the stack trace as far as I could, and I can’t find where search is being requested.
@Forrest Thank you for your feedback. I have enabled source maps so here you can have more details about the issue.
rollup-plugin-web-worker-loader__helper__funcToSource.js:7 Uncaught TypeError: Cannot read properties of undefined (reading 'search')
at e6 (rollup-plugin-web-worker-loader__helper__funcToSource.js:7:38)
at t6 (rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js:4:17)
at new <anonymous> (rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js:12:22)
at Object.t.setDataArray (PiecewiseGaussianWidget.js:523:20)
at Object.t.setupContent (VolumeController.js:123:18)
at Proxy.loadVolume (VtkWindow.vue:175:24)
at FileReader.t.onload (App.vue:90:38)
function funcToSource(fn, sourcemapArg) {
var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;
var source = fn.toString();
var lines = source.split('\n');
lines.pop();
lines.shift();
var blankPrefixLength = lines[0].search(/\S/); // <--- Error is here!
var regex = /(['"])__worker_loader_strict__(['"])/g;
for (var i = 0, n = lines.length; i < n; ++i) {
lines[i] = lines[i].substring(blankPrefixLength).replace(regex, '$1use strict$2') + '\n';
}
if (sourcemap) {
lines.push('\/\/# sourceMappingURL=' + sourcemap + '\n');
}
return lines;
}
export { funcToSource as f };
Hope this helps to find the cause of the build issue.
Hello @Forrest, I’m sorry for bothering you, but it’s over one month since I reported the issue and I can not go live with my project because of the build issue.
Could you please give some feedback? I thought the issue was related to Vuejs vite so I tried the Vue CLI approach but I got the same error.