Troubleshooting installation of @sanity/google-maps-input and missing module error
The "Cannot find module 'prop-types'" error you're seeing is a missing dependency issue. The @sanity/google-maps-input plugin relies on prop-types but it's not being installed automatically as a peer dependency.
Here's how to fix it:
Install the missing dependency:
npm install prop-typesor if you're using yarn:
yarn add prop-typesWhy this happens:
The @sanity/google-maps-input plugin was built for an earlier version of Sanity Studio and may have outdated dependency declarations. In older React applications, prop-types was commonly used for runtime type checking, but in modern setups it needs to be explicitly installed if a package requires it.
Additional troubleshooting:
If you continue to see errors after installing prop-types, you might also need to check:
Studio version compatibility - The
@sanity/google-maps-inputplugin may not be fully compatible with Sanity Studio v3/v4. Check the plugin's npm page or GitHub repository for compatibility information.Other missing dependencies - Sometimes plugins have other peer dependencies. If you see similar "Cannot find module" errors for other packages (like
styled-components), install those as well:npm install styled-componentsConsider alternatives - If the plugin continues to cause issues, you might want to look at building a custom input component using the Google Maps JavaScript API directly, or check if there are more recently maintained alternatives in the Sanity ecosystem.
After installing the missing dependencies, restart your Studio dev server and the errors should be resolved!
Sanity ā Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.