perliedman / leaflet-control-geocoder

A simple geocoder form to locate places. Easily extended to multiple data providers.
http://www.liedman.net/leaflet-control-geocoder/
BSD 2-Clause "Simplified" License
567 stars 222 forks source link

Main file in 1.5.2 on npm appears broken #146

Closed perliedman closed 8 years ago

perliedman commented 8 years ago

An error message like this is shown:

Cannot find module '../util' from 'C:\\Users\\per\\Documents\\source\\tellus-map-widget\\node_modules\\leaflet-control-geocoder\\dist'
jcoupey commented 8 years ago

Hi, first of all, thank you for taking the time to release 1.5.2!

I gave it a try and was about to report about something like this too.

On npm install I'm getting:

> leaflet-control-geocoder@1.5.2 postinstall [project_folder]/node_modules/leaflet-control-geocoder
> sh ./scripts/build.sh

Error: Cannot find module 'es3ify' from '[project_folder]/node_modules/leaflet-control-geocoder'

so the command at https://github.com/perliedman/leaflet-control-geocoder/blob/v1.5.2/scripts/build.sh#L5 fails and the file dist/Control.Geocoder.js is empty.

I can bypass this if I install es3ify as a dependency on my project level (then the same occurs for browserify-shim) but it doesn't feel quite right. And if I do so, I end up with an error similar to the one you report:

Error: Cannot find module './geocoders/nominatim' from '[project_folder]/node_modules/leaflet-control-geocoder/dist'

I'm sorry that my npm packaging skills don't allow me to help here, but I'm happy to test or investigate if required!

perliedman commented 8 years ago

Yeah, I was a bit too quick here. The goal was to remove dependency on es3ify and browserify-shim for users of the plugin, and only use them when building. Fixing that up on a friday afternoon apparently wasn't ideal :stuck_out_tongue_winking_eye:

I'll try to find to look into fixing this...

perliedman commented 8 years ago

Ok, hopefully fixed this in 1.5.3, please try it out!

jcoupey commented 8 years ago

Works like a charm, thanks! \o/