visgl / loaders.gl

Loaders for big data visualization. Website:
https://loaders.gl
Other
709 stars 193 forks source link

ParquetLoader: compression-worker.js has no exports #2732

Closed m-mohr closed 1 year ago

m-mohr commented 1 year ago

I'm trying to load a GeoParquet file using the loaders.gl 4.0.0-beta.7:

import {ParquetLoader} from '@loaders.gl/parquet';
import {load} from '@loaders.gl/core';
// ...
const parquet = await load(geoparquet.href, ParquetLoader, {
  worker: false,
  parquet: {
    shape: 'geojson-table',
    preserveBinary: true,
  },
});

Unfortunately, I'm getting:

ERROR in ../node_modules/@loaders.gl/compression/dist/index.js 10:0-78 export 'CompressionWorker' (reexported as 'CompressionWorker') was not found in './compression-worker.js' (module has no exports) ERROR in ../node_modules/@loaders.gl/compression/dist/index.js 10:0-78 export 'compressOnWorker' (reexported as 'compressOnWorker') was not found in './compression-worker.js' (module has no exports)

I'm building with webpack 5.88.2.

m-mohr commented 1 year ago

So I've tried it in the webpack-5 example that is in this repo and it works if I run it from a TS file, but in a JS file (I basically just renamed index.ts to index.js) I get the same issue as reported above. I assume loaders.gl is meant to also work with JS?

belom88 commented 1 year ago

As a temporary solution, I've added

parser: {
      javascript: {
        exportsPresence: "warn",
      },
    },

to the webpack.config in "I3S Explorer". See https://github.com/visgl/loaders.gl-showcases/blob/master/webpack.prod.config.js#L11

ibgreen commented 1 year ago

I am hoping changes in this PR will fix it: https://github.com/visgl/loaders.gl/pull/2730.

I think the root cause was a an output file was being clobbered in the new build tooling setup so I renamed it.

Let's test again when beta.8 comes out, hopefully later today.

m-mohr commented 1 year ago

It did, thanks a lot!