geotiffjs / geotiff.js

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.
https://geotiffjs.github.io/
MIT License
879 stars 184 forks source link

Missing export getFloat16 #345

Open PabloBitGenoma opened 1 year ago

PabloBitGenoma commented 1 year ago

I'm worknig with OpenLayers to draw a map and this error came to prevent my app to build.

Rollup: Missing Export: ./node_modules/geotiff/dist-module/geotiffimage.js:2:9 'getFloat16' is not exported by ./node_modules/@petamoriken/float16/browser/float16.js, imported by ./node_modules/geotiff/dist-module/geotiffimage.js

Everything seems ok (all dependencies installed & versions checked) but for some reason npm can't find the exported function getFloat16 required in /node_modules/geotiff/dist-module/geotiffimage.js

PabloBitGenoma commented 1 year ago

Found the bug. Importing like this triggers the error: import { Cluster, Vector as VectorSource } from 'ol/source'; import { Tile as TileLayer, Vector as VectorLayer } from 'ol/layer';

Importing as below solves it: import TileLayer from 'ol/layer/Tile'; import VectorLayer from 'ol/layer/Vector'; import Cluster from 'ol/source/Cluster'; import VectorSource from 'ol/source/Vector';

prabhjot-brightly commented 1 year ago

@PabloBitGenoma still facing the issue

paulthatjazz commented 1 year ago

Experiencing a very similar issue on a pretty large project, did you ever pinpoint what the specific cause was from OpenLayers?

paulthatjazz commented 1 year ago

I ended up using this: import * as GeoTIFF from 'geotiff/dist-browser/geotiff'

resolved my issue somehow.

achmed13 commented 1 year ago

Same issue. I worked around it by requiring "@petamoriken/float16": "3.4.7" in my package.json. Seems to be related to a newer release of float16.