react-google-places-autocomplete icon indicating copy to clipboard operation
react-google-places-autocomplete copied to clipboard

Error Message in Next JS - TypeError: (0 , o.rulesheet) is not a function

Open ticpoi opened this issue 2 years ago • 1 comments

When we used the library on local everything was fine. But on deployment it broke the complete application and throwed "TypeError: (0 , o.rulesheet) is not a function" error message seen on console.

On first research it looks like related with import statements. So tried these; import GooglePlacesAutocomplete from 'react-google-places-autocomplete' import { getLatLng, geocodeByAddress } from 'react-google-places-autocomplete'

or

import GooglePlacesAutocomplete , { getLatLng, geocodeByAddress } from 'react-google-places-autocomplete'

None of them worked on server.

So I removed the library and the problem gone.

ticpoi avatar Jul 04 '22 19:07 ticpoi

I am seeing a similar error using Next.js but only in development mode:

Screen Shot 2022-10-03 at 2 18 30 PM Screen Shot 2022-10-03 at 2 18 42 PM

I am using the latest version 3.4.0 from npm.

Downgrading to 3.3.0 fixed the issue for me.

thallada avatar Oct 03 '22 18:10 thallada

I think this is related that nextJs updates to React 18 and the version of react-select used in the library is the older version. There is an open issue since november and still no bump to the existing dependency :(

madaher-dev avatar Jan 07 '23 15:01 madaher-dev

@ticpoi This should be fixed now on v4.0.0. Will close the issue but if it's still preset lmk and I can reopen!

Bare in mind I had to use a dynamic import.

Tintef avatar Apr 16 '23 16:04 Tintef