Upgrading to Sanity v3 causes "No matching export" error in RxJS
This is a known issue that occurred during the v2 to v3 migration, and it's specifically related to the @sanity/document-internationalization plugin having incompatible RxJS peer dependencies. Here's what's happening and how to fix it:
The Root Cause
The error you're seeing is because @sanity/document-internationalization version 1.0.5 requires RxJS v6, but Sanity v3 uses RxJS v7. This creates a peer dependency conflict that npm can't resolve automatically.
Solutions (in order of preference)
1. Update the document-internationalization plugin (Best solution)
The plugin has been updated to support RxJS v7. According to the community discussion, updating to @sanity/document-internationalization@^1.1.0 or later should resolve this. Make sure you're on the latest version:
npm install @sanity/document-internationalization@latest2. Use the --legacy-peer-deps flag
As confirmed in this thread, installing with the legacy peer deps flag works as a workaround:
npm install --legacy-peer-depsYou can also add this to your .npmrc file to make it permanent:
legacy-peer-deps=true
3. Clean install process
Sometimes the issue resolves with a complete clean install:
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps4. Temporary workaround (if nothing else works)
Add RxJS 7.8.0 as a dev dependency to force the correct version:
npm install rxjs@^7.8.0 --save-dev --legacy-peer-depsWhy This Happens
This is a transitional issue that affected early v3 adopters. The @sanity/document-internationalization plugin initially had a peer dependency on RxJS v6, while Sanity v3 moved to RxJS v7. The plugin has since been updated, but if you're using an older version or have a locked package-lock.json, you'll hit this conflict.
The good news is that several people in the community reported that after trying these solutions (particularly the clean install or updating the plugin), "it suddenly started working" - so don't give up if the first attempt doesn't work!
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.