geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
First of all, congrats on release v1.0.0 of geotiff.js!
I'm having an issue when trying to use the new version 1.0.0 of geotiff.js in Node v12. It looks like dist-node/geotiff.js does not correctly export AggregateError, and instead creates some invalid Javascript code, (e.g. const h=void 0===h?g:h; which fails with ReferenceError: Cannot access 'h' before initialization ) for the line:
I believe this is because babel/parcel is rewriting export const AggregateError = AggregateError; to const x = x; exports.x = x; which is invalid JavaScript.
Potential fixes
We can fix it by renaming the export so it's not the same as AggregateError: (e.g. export const PolyfilledAggregateError = ...).
Or better yet, if you install core-js: "^3.9" and change your .babelrc file to the following, Babel should automatically add AggregateError to the dist-node folder, so you don't need to make your own version:
First of all, congrats on release v1.0.0 of
geotiff.js
!I'm having an issue when trying to use the new version 1.0.0 of
geotiff.js
in Node v12. It looks likedist-node/geotiff.js
does not correctly exportAggregateError
, and instead creates some invalid Javascript code, (e.g.const h=void 0===h?g:h;
which fails withReferenceError: Cannot access 'h' before initialization
) for the line:https://github.com/geotiffjs/geotiff.js/blob/c01b2dcf00d5a324cd27c38709cb6ca97adf01e2/src/utils.js#L159
I believe this is because babel/parcel is rewriting
export const AggregateError = AggregateError;
toconst x = x; exports.x = x;
which is invalid JavaScript.Potential fixes
We can fix it by renaming the export so it's not the same as
AggregateError
: (e.g.export const PolyfilledAggregateError = ...
).Or better yet, if you install
core-js: "^3.9"
and change your.babelrc
file to the following, Babel should automatically add AggregateError to thedist-node
folder, so you don't need to make your own version: