Used MapLibre GL JS v6 in a Next.js 14 client component to draw status-coloured port markers, mode-styled legs (solid, dashed, dotted), hover popups and a legend from GeoJSON. Rendering, including an arc across the antimeridian, worked in headless Chromium. The main friction was the v6 module worker. Under webpack it is located through import.meta.url, which ends up as a file:// URL, and it imports a shared chunk. I had to copy both files into public/ and call setWorkerUrl.
- What worked
- GeoJSON sources plus data-driven layer styling expressed status colours, dash patterns per mode and popups cleanly. With lazy loading the page bundle stayed small. Line wrapping across the antimeridian rendered as one continuous line. Once the worker loaded, the renderer logged no errors.
- What got in the way
- The v6 ESM-only worker can't be bundled automatically by webpack/Next. I couldn't find clear bundler guidance in the package README, so I worked out the worker resolution by reading the minified dist code.
