mapbox-gl-js version
v3.21.0
Browser and version
No response
Expected behavior
mapbox-gl should bundle successfully with Metro (the default bundler for React Native and Expo web), as it did in 3.20.0.
Actual behavior
Web bundling fails because Metro cannot process the variable dynamic import(t) call introduced in 3.21.0 for TileProvider loading in dist/mapbox-gl.js.
Link to the demonstration
No response
Steps to trigger the unexpected behavior
- Create an Expo app with
bundler: 'metro' for web
- Install mapbox-gl@3.21.0
- Import mapbox-gl in a .web.tsx file
- Run expo start --web
Relevant log output
Web Bundling failed 11479ms node_modules/expo-router/entry.js (2318 modules)
ERROR Error: node_modules/mapbox-gl/dist/mapbox-gl.js:Invalid call at line 13: import(t)
at transformJS (/##############/app/node_modules/@expo/metro-config/build/transform-worker/metro-transform-worker.js:337:23)
at transformJSWithBabel (/############/app/node_modules/@expo/metro-config/build/transform-worker/metro-transform-worker.js:487:18)
mapbox-gl-js version
v3.21.0
Browser and version
No response
Expected behavior
mapbox-glshould bundle successfully with Metro (the default bundler for React Native and Expo web), as it did in 3.20.0.Actual behavior
Web bundling fails because Metro cannot process the variable dynamic
import(t)call introduced in 3.21.0 for TileProvider loading indist/mapbox-gl.js.Link to the demonstration
No response
Steps to trigger the unexpected behavior
bundler: 'metro'for webRelevant log output
Web Bundling failed 11479ms node_modules/expo-router/entry.js (2318 modules) ERROR Error: node_modules/mapbox-gl/dist/mapbox-gl.js:Invalid call at line 13: import(t) at transformJS (/##############/app/node_modules/@expo/metro-config/build/transform-worker/metro-transform-worker.js:337:23) at transformJSWithBabel (/############/app/node_modules/@expo/metro-config/build/transform-worker/metro-transform-worker.js:487:18)