rii-mango / NIFTI-Reader-JS

A JavaScript NIfTI file format reader.
MIT License
137 stars 30 forks source link

Error when uploading NIfTI file in console.html - Cannot read properties of undefined (reading 'readHeader') #40

Closed dhanashreemhatre closed 4 months ago

dhanashreemhatre commented 5 months ago

When I open the console.html file from the repository and attempt to upload a NIfTI file, I encounter an issue. The file upload does not proceed as expected, and an error is displayed in the console.

Steps to Reproduce: Clone the repository: git clone https://github.com/your-repository.git Open the console.html file in a web browser. Upload a valid NIfTI file using the provided file upload interface. Observe the error in the browser’s console. Expected Behavior: The NIfTI file should upload successfully, and the application should process and display the file contents correctly.

Actual Behavior: The file upload fails, and the following error is displayed in the browser’s console: browser.html:18 Uncaught TypeError: Cannot read properties of undefined (reading 'readHeader') at readNIFTI (browser.html:18:32) at reader.onloadend (browser.html:53:21) readNIFTI @ browser.html:18 reader.onloadend @ browser.html:53 FileReader (async) readFile @ browser.html:57 handleFileSelect @ browser.html:62

Screenshot 2024-05-28 100218 Screenshot 2024-05-28 100853

Additional Information: I have tried uploading different NIfTI files and using different browsers, but the issue persists. No modifications were made to the code or configuration.

aglasencnik commented 5 months ago

I get the same error.... Have you found a way to resolve it?

aglasencnik commented 4 months ago

I found that you have to bundle the source files with eg. webpack. And then it works...

dhanashreemhatre commented 4 months ago

I get the same error.... Have you found a way to resolve it?

Yeah I resolved it. Will share it with you !!