Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Error installing Transifex Plugin due to duplicate definition of part

5 replies
Last updated: Aug 19, 2022
Plugins “@sanity/production-preview” and “@sanity/production-preview” both define part “part:@sanity/transitional/production-preview/resolve-production-url”
Trying to install Transifex Plugin (
https://www.sanity.io/plugins/sanity-plugin-transifex ) when
exec populateTransifexSecrets.js --with-user-token
fails with
 $ sanity exec populateTransifexSecrets.js --with-user-token
/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/resolver/lib/resolver.js:170
    throw new Error("".concat("Plugins ".concat(existing, " and ").concat(current, " both define part \"").concat(part.name, "\"") + ' - did you mean to use "implements"?\n' + 'See ').concat((0, _generateHelpUrl.generateHelpUrl)('part-declare-vs-implement')));
    ^

Error: Plugins "@sanity/production-preview" (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/production-preview) and "@sanity/production-preview" (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/production-preview) both define part "part:@sanity/transitional/production-preview/resolve-production-url" - did you mean to use "implements"?
See <https://docs.sanity.io/help/part-declare-vs-implement>
    at assignDefinitionForAbstractPart (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/resolver/lib/resolver.js:170:11)
    at /Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/resolver/lib/resolver.js:137:9
    at Array.forEach (<anonymous>)
    at /Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/resolver/lib/resolver.js:133:11
    at Array.forEach (<anonymous>)
    at mergeResult (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/resolver/lib/resolver.js:130:15)
    at resolveParts (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/resolver/lib/resolver.js:50:12)
    at registerLoader (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/plugin-loader/loader.js:35:7)
    at Object.<anonymous> (/Users/kristoffer.nordkvist/src/web-client-cms/web-client-cms/node_modules/@sanity/core/lib/actions/exec/pluginLoader.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
Aug 18, 2022, 9:58 AM
Could you nuke your node modules and reinstall them fresh please?
Aug 18, 2022, 9:59 AM
It fails the same way
Aug 18, 2022, 10:12 AM
Can you share your sanity.json?
Aug 18, 2022, 5:01 PM
Yep! Thanks for looking into this 🙂
Aug 19, 2022, 7:51 AM
Solved!
@sanity/production-preview
was defined twice. Both in plugins but also in env.development.plugins in sanity.json.
Thank you for your time
🙏
Aug 19, 2022, 11:05 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?