calvinmetcalf / shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
http://calvinmetcalf.github.io/shapefile-js/
MIT License
735 stars 230 forks source link

shpjs_1.default is not a function (angular 7) #107

Closed mkaa closed 5 years ago

mkaa commented 5 years ago

tried this with angular 7 but i can't find any workaround. it used to work with angular 6

calvinmetcalf commented 5 years ago

did something change in angular between 6 and 7 with regard to commonjs modules ? the error you get suggests it's trying to load it as a default export of a es6 module instead of a normal module.exports

mkaa commented 5 years ago

it worked. i'm not good with angular but i just changed

import shp from 'shpjs';

to

import * as shp from 'shpjs';