Which versions are affected?
All Content Hub v4.0 and higher. Sitecore has created a fix from v4.1.11 and higher.
MONE-31135 Fixed an issue with failing to import shared scripts.
Is a workaround available?
If you're not able to upgrade, the only thing you can do is ditch the shared script and embed the code in the calling script. Unfortunately, this will give some duplication of the code.
Opinion
The shared script really look like a good idea, but now that I've more experience working with them, I would suggest staying away from the functionality. At first sight, when you start using a shared script, everything looks fine. Then you realize you need a change in the shared script. You think that's easy because it's shared. But then the problems begin to arise.
Your shared script might be upgraded, re-compiled and published, but all scripts that reference this shared script, need to be re-compiled and published as well! So the more scripts that reference your shared script, the bigger your problem will become. This will be a problem to maintain all the scripts in this way.