calvinmetcalf / shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
http://calvinmetcalf.github.io/shapefile-js/
714 stars 228 forks source link

Error: nodebuffer is not supported by this browser #166

Closed Mylothros-Charalampos closed 2 years ago

Mylothros-Charalampos commented 2 years ago

I am uploading .zip file which has shapefile in it, I am converting it into a buffer and the moment I pass the buffer in shp(buffer) I get this error Error: nodebuffer is not supported by this browser. I am using gatsby v3 with react and react dom 17.0.1 respectively. I tried already only to apply the .shp file and use shp.parseShp('.shpfile') and it works but I dont get to pass any feature.properties like this. Do you have any suggestion why this could happen.

calvinmetcalf commented 2 years ago

use this in your webpack config (that's what gatsby uses under the hood) https://github.com/Richienb/node-polyfill-webpack-plugin)

Mylothros-Charalampos commented 2 years ago

thank you it worked :)

weixiaoxiang commented 11 months ago

thank you it worked :)