Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting 'strict: true' in tsconfig breaks build in Angular #934

Closed
HaibaneReki opened this issue Feb 2, 2022 · 1 comment
Closed

Setting 'strict: true' in tsconfig breaks build in Angular #934

HaibaneReki opened this issue Feb 2, 2022 · 1 comment

Comments

@HaibaneReki
Copy link

maplibre-gl-js version: latest (2.1.1)

browser: irrelevant

Steps to Trigger Behavior

  1. Generate a clean angular project
ng new MyApp
  1. add dependencies - include point-geometry and vector-tile as discussed in related issues
    "maplibre-gl": "^2.1.1",
    "@mapbox/point-geometry": "^0.1.0",
    "@mapbox/vector-tile": "^1.3.1"
  1. add dev dependencies
    "@types/geojson": "^7946.0.8",
    "@types/mapbox__point-geometry": "^0.1.2",
    "@types/mapbox__vector-tile": "^1.3.0"
  1. in AppComponent
import maplibre from 'maplibre-gl'
  1. install packages
npm install
  1. set strict mode in tsconfig.json
"compilerOptions": {
    "strict": true
}
  1. serve
ng s

Link to Demonstration

I spent more time than I'm willing to admit trying to reproduce this on Stackblitz, but failed. It seems to only happen locally.

Expected Behavior

Project serves/builds

Actual Behavior

Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:2232:61 - error TS2344: Type 'Us' does not satisfy the constraint '{}'.
  Type 'unknown' is not assignable to type '{}'.

2232 export declare type UniformValues<Us extends any> = $ObjMap<Us, <V>(u: Uniform<V>) => V>;
                                                                 ~~


Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:8635:4 - error TS2411: Property 'mousemove' of type 'undefined' is not assignable to string index type '(e: any) => void'.

8635    mousemove?: undefined;
        ~~~~~~~~~


Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:8636:4 - error TS2411: Property 'mouseout' of type 'undefined' is not assignable to string index type '(e: any) => void'.

8636    mouseout?: undefined;
        ~~~~~~~~
@HarelM
Copy link
Collaborator

HarelM commented Feb 2, 2022

Seem like a duplicate of #790 (last comment and build error).
Any help to solve this would be extremely appreciated.
I'm closing this in favor of #790.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants