If you have multiple versions of @smithy/types
in your dependencies, it may break type checking.
To fix type checking:
- Install this package
npm install --save-dev smithy-types-override
- Update your
package.json
to use package overrides
{
"overrides": {
"dependency": {
"smithy-types-override": "$@smithy/types"
}
}
}
- Update your imports to use the overridden file
import type { NodeJsClient, BrowserClient } from "smithy-types-override";
-
???
-
Profit
Your types will now always be imported from the latest version of @smithy/types
and you can avoid type errors 🎉
The permanent solution would be for all of your dependencies to use the same and latest version of @smithy/types
, which may never happen.