Open tyler-dunkel opened 3 years ago
I can confirm that there are some problems, but not sure the root cause. AWS SDK is installed correctly but when I try to load it via require it throws the above exception.
It looks like something related some global object that it is not initialized as expected. I suspect that it is something related to how I initialize the VM object here. But for now I don't have much information ...
I will try to investigate in the future, but as usual any help is appreciated...
I have started looking into this and have noticed where one of the changes is occurring. The file aws-sdk/lib/util.js
has a function inherit
. This function assigns an object to a constructor.prototype
in this line features.constructor.prototype = newObject;
. In both the live plugin manager AND as a regular dep, newObject
is equal to Service {}
. However, when I print out the result of features
after the above line, things change.
When installing the aws-sdk as a regular dep:
FEATURES WITH CONSTURCTOR
{ constructor: [Function (anonymous)] }
When installing with live plugin manager:
FEATURES WITH CONSTURCTOR
{}
Do you have any idea on why this code would function differently in live plugin manager? I dont see any difference within the code itself.
Thank you @tyler-dunkel for your further investigation. I have tried to work on that issue in #63 . I should have fixed some errors, but aws-sdk still doesn't work ... I suspect that there is some other errors in that code, but for now I don't understand.
@tyler-dunkel @aacotroneo Can you try to help me by writing a unit test to reproduce the problem? See for example the following tests: https://github.com/davideicardi/live-plugin-manager/blob/46550cf0e02ad2f32a735111a7b995f4b06107f2/test/PluginManagerSuite.ts#L1275
I am trying to install and require the
aws-sdk
package at runtime and am getting the following errorThis error does not appear when installing the
aws-sdk
directly and importing it. I tried with several versions of the package with the same result.Here is some simple code to test