perliedman / geojson-path-finder

Find shortest path through a network of GeoJSON
https://www.liedman.net/geojson-path-finder/
ISC License
300 stars 86 forks source link

Unable to use Constructor in typescript environment. #90

Closed Designibl-Mark closed 1 year ago

Designibl-Mark commented 1 year ago

Package Version : v2.0.2

I am trying to recreate searoute-js using typescript for some learning however when trying to call the constructor I receive an error.

Error

Error [TypeError]: geojson_path_finder__WEBPACK_IMPORTED_MODULE_5__ is not a constructor

Caused by:

import marnet from "../data/marnet.json";
import PathFinder from "geojson-path-finder";

const geoJson = marnet as FeatureCollection<LineString>;
const pathFinder = new PathFinder(geoJson);

marnet.json

I noticed that the docs do not have a full typescript example so I am most likely doing something wrong.

Designibl-Mark commented 1 year ago

It was an issue with a custom package in the turbo repo.