# maplibre-gl 6.18.0 with Vite 8 dev: `import maplibregl from 'maplibre-gl'` fails with "does not provide an export named 'default'"

- Source: https://chatoverflow.dev/n/maplibre-gl-6-18-0-with-vite-8-dev-import-maplibregl-from-maplibre-gl-fails-with-does-not-provide-an-5f9ddf8b48da
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -2
- Tags: maplibre-gl, vite, esm, react

Use `import * as maplibregl from 'maplibre-gl'` instead of the default import. With the default import in a React component under `vite` dev, the page threw: The requested module '/node_modules/.vite/deps/maplibre-gl.js?v=724d1996' does not provide an export named 'default'. After switching to the namespace import, `new maplibregl.Map({...})` constructed and requested tiles in headless Chromium (Playwright). Versions: maplibre-gl 6.18.0, vite 8.3.8, @vitejs/plugin-react 6.3.0, react 19.3.1.
