mapbox-gl-draw icon indicating copy to clipboard operation
mapbox-gl-draw copied to clipboard

I am facing build issue with imports, is this related to new push ?

Open Sehbaz opened this issue 2 years ago • 11 comments

Sehbaz avatar Feb 07 '23 12:02 Sehbaz

Screenshot from 2023-02-06 20-29-57

Sehbaz avatar Feb 07 '23 12:02 Sehbaz

Hi @Sehbaz,

Thank you for opening this ticket! Could you please provide a minimal demonstration of the issue to help the maintainers and community understand and address the problem accurately?

stepankuzmin avatar Feb 07 '23 12:02 stepankuzmin

Hi @Sehbaz,

Thank you for opening this ticket! Could you please provide a minimal demonstration of the issue to help the maintainers and community understand and address the problem accurately?

I am building custom tools in mapbox using this library where i am importing modes in a file. Till 05/02/2023 it was working fine and i was to build my project for deployment. But all if sudden this imports started throwing error.

IMPORTS: image

image

Package.json image

Sehbaz avatar Feb 07 '23 13:02 Sehbaz

Is it a TypeScript project? Most likely, this is caused by the old typings that should be updated in the DefinitelyTyped project https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-draw

stepankuzmin avatar Feb 07 '23 14:02 stepankuzmin

Is it a TypeScript project? Most likely, this is caused by the old typings that should be updated in the DefinitelyTyped project https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-draw

Thank you, will give that a go.

Sehbaz avatar Feb 07 '23 14:02 Sehbaz

Is it a TypeScript project? Most likely, this is caused by the old typings that should be updated in the DefinitelyTyped project https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-draw

it is a VUE project.

Sehbaz avatar Feb 07 '23 14:02 Sehbaz

I'm having the same problem. The thing is npm installing "@mapbox/mapbox-gl-draw" doesn't come with the "src/" folder anymore. Some other packages rely on the "src" to function correctly.

An example would be: "mapbox-gl-draw-passing-mode" or "mapbox-gl-draw-select-mode"

bernardiego avatar Feb 10 '23 01:02 bernardiego

@bernardiego What was your solution ?

Sehbaz avatar Feb 10 '23 08:02 Sehbaz

I had to force install version 1.3.0 of "@mapbox/mapbox-gl-draw".

... "@mapbox/mapbox-gl-draw": "1.3.0", (Instead of "^1.3.0") ...

bernardiego avatar Feb 10 '23 11:02 bernardiego

Is it a TypeScript project? Most likely, this is caused by the old typings that should be updated in the DefinitelyTyped project https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__mapbox-gl-draw

I submitted a PR a few days ago to update types as per v 1.4. It’s waiting for the owners to review it.

joel-daros avatar Feb 17 '23 18:02 joel-daros

You can still access the constants in latest release via the MapboxDraw import eg:

import MapboxDraw from '@mapbox/mapbox-gl-draw';

console.log(MapboxDraw.constants.modes);

outputs:

{
    DRAW_LINE_STRING: 'draw_line_string',
    DRAW_POLYGON: 'draw_polygon',
    DRAW_POINT: 'draw_point',
    SIMPLE_SELECT: 'simple_select',
    DIRECT_SELECT: 'direct_select',
    STATIC: 'static'
}

joseph-sm avatar Mar 27 '23 02:03 joseph-sm