algolia / places

:globe_with_meridians: Turn any <input> into an address autocomplete
https://community.algolia.com/places/
MIT License
5.35k stars 234 forks source link

Error in AlgoliaSearchCore.js #1193

Closed ninadsutrave closed 1 year ago

ninadsutrave commented 1 year ago

I am building a weather forecast application for which I need suggestions of places to appear as the user types in his location. I have installed the places.js npm package for this purpose however just even importing it throws an error and brings the application down.

This is the message and the stack trace I get at the browser console.

ReferenceError: process is not defined at node_modules/algoliasearch/src/AlgoliaSearchCore.js (AlgoliaSearchCore.js:13:3) at require2 (chunk-7FP5O474.js?v=65b02d0e:10:50) at node_modules/algoliasearch/src/browser/builds/algoliasearchLite.js (algoliasearchLite.js:3:25) at __require2 (chunk-7FP5O474.js?v=65b02d0e:10:50) at node_modules/places.js/src/places.js (places.js:10:49) at require2 (chunk-7FP5O474.js?v=65b02d0e:10:50) at node_modules/places.js/index.js (index.js:9:14) at __require2 (chunk-7FP5O474.js?v=65b02d0e:10:50) at index.js:15:43

Haroenv commented 1 year ago

Those packages were made at a time when process was still commonly poly filled by browsers. You can either use https://gist.github.com/ef4/d2cf5672a93cf241fd47c020b9b3066a or DefinePlugin({ 'process.env.NODE_ENV': 'production' }) https://webpack.js.org/plugins/define-plugin/#usage

Regardless of this, the service running places is no longer active, so I don't think you'll get a working product in the end.

ninadsutrave commented 1 year ago

Which 'service' running places are you referring to? Is the Algolia Places API itself shut down?

Haroenv commented 1 year ago

the Algolia Places API is indeed shut down

ninadsutrave commented 1 year ago

Damn that's bad. Can I ask you for any free alternatives that I could possibly use for my project? As already mentioned I need a dropdown list of place suggestions that autocomplete what the user is typing. Thank you in advance!

Haroenv commented 1 year ago

some alternatives are listed in this post: https://www.algolia.com/blog/product/sunsetting-our-places-feature/