mapbox / mapbox/mapbox-gl-draw

Library crashing with source-map-loader in angular 15

Open
#1,147 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged needs information
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

I have just installed this mapbox-gl-draw into my angular 15 project with the types. Each type I import the it like this:
import * as MapboxDraw from '@mapbox/mapbox-gl-draw';
It gives me an error about other pre-installed library called sourece-map-loader
I tried to downgrade the version until 1.2.0 that is the first one but the problem contiues.

mapbox-gl-js version: 2.12.0
mapbox-gl-draw version: 1.3.0

Steps to Trigger Behavior
  1. Build an angular 15 project
  2. npm download mapbox.gl-js and mapbox-gl-draw
  3. import mapbox-gl-draw into the project to add MapboxDraw
Expected Behavior

Normal compiling.

Actual Behavior

I have an error in the index.js
`Compiled with problems:

ERROR in ./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js

Module build failed: .../node_modules/source-map-loader/dist/cjs.js:3
import loader, { raw } from "./index.js";`

Thank you very much!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Angular 15 build using the listed mapbox-gl-js and mapbox-gl-draw versions, then inspect node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.js and node_modules/source-map-loader/dist/cjs.js around the reported index.js import. Done means the project compiles normally when importing MapboxDraw.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.