Context contamination between plugins in a same theia instance
December 13, 2019 at 10:05pmContext contamination between plugins in a same theia instance
December 13, 2019 at 10:05pmHi there
Here is my issue:
- I happen to have 2 vscode extensions (theia plugins), both use a shipped inversify (for clarity, I really am using plugin, not theia extension)
- both webpack do ship inversify (we have not flagged it as external and I can see it in my output code)
- yet when I run in theia, the plugin that is activated second is contaminated by the first. I can clearly see it in the logs. I am wondering how the vscode-unpacked context works. are they closured ? should I assumed they are not isolated ? Thanks in advance for your help
December 13, 2019 at 11:52pm
Hi there, after more investigations it turns out the issue only arise if I use a string serviceIdentifier as opposed to a runtime representation like a class, I am suspecting a bug on inversify side, Have you noticed it too ? Meanwhile, I consider my issue resolved unless you think there is as well a context stickiness issue with Theia. Thanks
December 15, 2019 at 8:48pm
Hi Frederic, we have not heard about it. Generally node.js allow to load multiple versions of the same library by different packages. It can break if a library install something on the global object for example, or vscode extensions misusing it somehow. I don't suspect inversify.js doing it, each DI container is isolated from another and can have different bindings for the same string value.
December 16, 2019 at 9:48am
does the problem occur as well in VS code?