Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with ESM async setup #22

Open
ndrean opened this issue Jan 9, 2025 · 0 comments
Open

Error with ESM async setup #22

ndrean opened this issue Jan 9, 2025 · 0 comments

Comments

@ndrean
Copy link

ndrean commented Jan 9, 2025

I use Vite to bundle.

In https://github.com/maptiler/leaflet-maptilersdk#from-es-module-the-async-way, you have:

const L = await import('leaflet');
const leafletmaptilersdk = await import('@maptiler/leaflet-maptilersdk'); 

The first line works if I use the "default":

const {default: L} = await import('leaflet');

but the second line fails:

[vite-plugin-pwa:build] node_modules/.pnpm/@[email protected]/node_modules/@maptiler/sdk/dist/maptiler-sdk.mjs (11:7): "default" is not exported by "node_modules/.pnpm/[email protected]/node_modules/events/events.js", imported by "node_modules/.pnpm/@[email protected]/node_modules/@maptiler/sdk/dist/maptiler-sdk.mjs".
file: /Users/nevendrean/code/elixir/solidyjs/assets/node_modules/.pnpm/@[email protected]/node_modules/@maptiler/sdk/dist/maptiler-sdk.mjs:11:7

I tried: import nodePolyfills from "rollup-plugin-polyfill-node"; and rollupOptons: {plugins: [nodePolyfills(/)],...} without success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant