Skip to content

2.19.x typing changes break compatibility with openlayers #512

@mfisher87

Description

@mfisher87

Heya! Thanks for this project :)

Our project needed to upper bound proj4js <2.19.0 after the recent release because our project fails to build. I created a minimal reproducible example: https://github.com/mfisher87/sscce-proj4js-2.19.x-incompat-with-ol

You should be able to repro following the instructions in the README.

$ npm run build

> [email protected] build
> tsc -p .

index.ts:4:10 - error TS2345: Argument of type 'ProjectionDefinition' is not assignable to parameter of type 'typeof import("/home/robatt/_test/proj4-type/ol-proj4-compat/node_modules/proj4/dist/lib/index")'.
  Property 'proj4' is missing in type 'ProjectionDefinition' but required in type 'typeof import("/home/robatt/_test/proj4-type/ol-proj4-compat/node_modules/proj4/dist/lib/index")'.

4 register(proj4.defs("EPSG:3413"));
           ~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/proj4/dist/lib/index.d.ts:1:1
    1 export default proj4;
      ~~~~~~~~~~~~~~~~~~~~~
    'proj4' is declared here.


Found 1 error in index.ts:4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions