Open martenjurgens opened 5 months ago
+1 Currently bumping into: ERROR: Could not resolve "@mapbox/mapbox-gl-draw/src/constants Tried downgrading mapbox-gl-draw to same version used in demo, a different error pops, can you update this library? Many thanks
Was able to fix this by importing cut-polygon-mode into my project and replacing the constants import in mode.js with:
const geojsonTypes = MapboxDraw.constants.geojsonTypes
const updateActions = MapboxDraw.constants.updateActions
const events = MapboxDraw.constants.events
If you're using Vite or webpack you could set an alias in the config:
// vite.config.ts
export default defineConfig({
resolve: {
alias: {
"@mapbox/mapbox-gl-draw/src/constants": resolve(__dirname, "patch.ts"),
},
},
});
// patch.ts
import { constants } from "@mapbox/mapbox-gl-draw";
const { events, geojsonTypes, updateActions } = constants;
export { events, geojsonTypes, updateActions };
Hello,
Could this please be updated to be compatible with the latest versions of mapbox-gl, @mapbox/mapbox-gl-draw and mapbox-gl-draw-passing-mode?
Thank you