Powered By Google not being imported - Require Cannot find module
See original GitHub issueHello, I get this error since lastest release 5.4.0, please help !
Uncaught Error: Cannot find module 'react-places-autocomplete/images/powered_by_google_default.png' from 'react-places-autocomplete/dist/PlacesAutocomplete.js'
Line 372 of /node_modules/react-places-autocomplete/dist/PlacesAutocomplete.js is generating the error.
this.props.googleLogo && _react2.default.createElement( 'div', { id: 'PlacesAutocomplete__google-logo', style: this.inlineStyleFor('googleLogoContainer'), className: this.classNameFor('googleLogoContainer') }, _react2.default.createElement('img', { src: require('./images/powered_by_google_' + this.props.googleLogoType + '.png'), style: this.inlineStyleFor('googleLogoImage'), className: this.classNameFor('googleLogoImage') }) )
When using hard coded path of copy of the image from my assets/images folder works perfectly. E.g. src: “http://localhost:4000/images/powered_by_google_default.png”
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:23 (7 by maintainers)
Expanding on @Floriferous 's solution, this is a quick workaround that I am using until something more permanent is implemented into the package.
You lose some semantics this way (by not having an inline image) but seems like a decent work around in the short time that could come in handy for some.
Would it make sense to remove Google Image from the library and add an optional
footer
prop so that user of the library can provide their custom footer element for the dropdown? Feedback would be appreciated!