protomaps / PMTiles

Cloud-optimized + compressed single-file tile archives for vector and raster maps
https://protomaps.com/docs/pmtiles/
BSD 3-Clause "New" or "Revised" License
2.11k stars 125 forks source link

fix: use named export for better typing #498

Closed Kanahiro closed 6 days ago

Kanahiro commented 6 days ago

Hi,

I use pmtiles module in TypeScript code like this and faced an error.

import { Protocol } from 'pmtiles'; // Module '"pmtiles"' has no exported member 'Protocol'.
const protocol = new Protocol();

I guess export * from "./adapters"; caused this and then re-write this with named export. If it is okay, please merge this.

bdon commented 3 days ago

Did you fix this? It's possible this is related to CJS packages (vs ESM) in your bundler, we need to make a new version that has proper CJS/ESM support.

bdon commented 3 days ago

See https://github.com/protomaps/PMTiles/pull/499

Kanahiro commented 3 days ago

Thank you for responding!

I tried to fix my typing problem and opened this pull-request. After that I found this may not be a solution for it and closed it. Acutually it is not fixed in my env.

I'll check it, thanks!

Kanahiro commented 3 days ago

@bdon I tried pmtiles-js-v4 and it seems to work fine!

bdon commented 2 days ago

I published v4.0.1. Please see if that fixes the issue or creates any new problem.