David Ewins
Error library

expo export fails on the web bundle: Unable to resolve module mapbox-gl/dist/mapbox-gl.css

ExpoConfirmed fix

@rnmapbox/maps

Error
Error: Unable to resolve module mapbox-gl/dist/mapbox-gl.css from node_modules/@rnmapbox/maps/lib/module/web/index.js

Cause

npx expo export builds every platform in app config, including web. @rnmapbox/maps' web entry imports mapbox-gl CSS, which is not installed in a native-only app.

Fix

Export only the platforms you ship:

shell
npx expo export --platform ios --platform android

(or remove web from platforms, or install mapbox-gl if you do ship web).

More Expo errors

Search all errors