rii-mango / NIFTI-Reader-JS

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

Bundle with esbuild replacing browserify and uglify #25

Closed nellh closed 1 year ago

nellh commented 1 year ago

Using this library in bids-validator via Deno, we have run into this issue when importing recent builds of nifti-reader-js:

This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.

The cause of this seems to be how browserify is shimming buffer, producing a build that triggers this error because of the different global namespace in Deno (even though Deno does provide Uint8Array).

Switching to esbuild solves this issue but may have some implications for other users of the library.

kmannislands commented 1 year ago

Ah, just seeing this. I'm working on converting this project to typescript and had the same thought over here:

https://github.com/rii-mango/NIFTI-Reader-JS/pull/26

Happy to get the change either way!