Tintef / react-google-places-autocomplete

React Google Places Autocomplete input -- fully customizable
https://tintef.github.io/react-google-places-autocomplete
MIT License
373 stars 161 forks source link

Error when use the lib #34

Closed sashberd closed 4 years ago

sashberd commented 4 years ago

Hi I just installed you lib and got this error

hot-dev-client.js:131 Uncaught (in promise) /node_modules/react-google-places-autocomplete/dist/GooglePlacesAutocomplete/index.css:1 (function (exports, require, module, filename, dirname) { .google-places-autocomplete { ^

SyntaxError: Unexpected token . at new Script (vm.js:80:7) at createScript (vm.js:274:10) at Object.runInThisContext (vm.js:326:10) at Module._compile (internal/modules/cjs/loader.js:664:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (/Users/alexanderberdichevsky/Desktop/Dev/floki/node_modules/react-google-places-autocomplete/dist/GooglePlacesAutocomplete/index.js:29:1) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Tintef commented 4 years ago

Hi @sashberd, can you provide with a repo where this can be reproduced? I'm not being able to do so

brandontle commented 4 years ago

@sashberd @Tintef I get the exact same error. Will make a repo to reproduce in the next few days.

@Tintef Try installing the library with a Next.js starter.

Tintef commented 4 years ago

@brandontle Thanks! I'll try that! If you could also provide a repo (just in case) it would great!

Tintef commented 4 years ago

@sashberd @brandontle

Can you test the newest release (1.6.0), I tried it on a fresh next.js project and it seems to works just fine. Please note that the css needs to be imported separately (for this to work on next you'll need to use https://github.com/zeit/next-plugins/tree/master/packages/next-css).

Let me know if it works!!

Tintef commented 4 years ago

I'll close this for now.