Error Message in Next JS - TypeError: (0 , o.rulesheet) is not a function
ticpoi opened this issue · 3 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.
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 :(