sanity-io / sanity-plugin-cloudinary

Official plugin for integrating Sanity Studio with Cloudinary
MIT License
21 stars 8 forks source link

v1.1.2 ERR_REQUIRE_ESM with nanoid v4.0.2 #70

Open amidadigital opened 9 months ago

amidadigital commented 9 months ago

Updating to the latest v1.1.2 results in the following error in the studio:

Error [ERR_REQUIRE_ESM]: require() of ES Module ...\nanoid@4.0.2\node_modules\nanoid\index.js Instead change the require of ...\nanoid@4.0.2\node_modules\nanoid\index.js in ...\sanity-plugin-cloudinary@1.1.2_react-dom@18.2.0_react-is@18.2.0_react@18.2.0_sanity@3.30.0_styled-components@6.1.8\node_modules\sanity-plugin-cloudinary\lib\index.js to a dynamic import() which is available in all CommonJS modules

Using pnpm.

Packages:

"sanity": "3.30.0",
"sanity-plugin-cloudinary": "^1.1.2"

Changelog in v1.1.2 shows that nanoid dependency was updated to v4. Reverting back to v1.1.1 fixes the issue while integrating the fix to resolve the styled components issue provided by @djfarly in https://github.com/sanity-io/sanity-plugin-cloudinary/issues/50#issuecomment-1921708925_

henrybabbage commented 7 months ago

Seeing this same issue too