I’m attempting to read a .nii.gz file from the Electron backend as a buffer and parse it on the Vue frontend. Based on some older posts I found, I tried the following code:
What is your setup like? Is this a vite dev server accessed through an electron interface? The error you’re getting is due to CSP errors. Either the server is sending a Content-Security-Policy header or the HTML contains CSP-related meta tags.
Yes. I’m using a Vite dev server through an Electron interface. The Content Security Policy (CSP) is set up in both the index.html file and the electron.vite.config.ts file.
I’ve confirmed that the arrayBuffer is successfully passed from the backend to the frontend through the Electron interface. Here’s the code that handles the file reading and processing: