Okay, I run into this a lot. At least since PNPM.
Here's at least one thing that's worked for me:
Whatever the non-portable type is that it's complaining about (something imported from another library and re-exported)...
- Create a named type alias for that type in the module
- Export that type alias
- Explicit cast the thing to that type alias