Open lukesmolo opened 2 years ago
For instance for mqtt library:
'events' is imported by node_modules/mqtt/lib/client.js, but could not be resolved – treating it as an external dependency
'events' is imported by events?commonjs-external, but could not be resolved – treating it as an external dependency
'url' is imported by node_modules/mqtt/lib/connect/index.js, but could not be resolved – treating it as an external dependency
'url' is imported by url?commonjs-external, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/mqtt/node_modules/readable-stream/readable.js, but could not be resolved – treating it as an external dependency
'stream' is imported by stream?commonjs-external, but could not be resolved – treating it as an external dependency
'net' is imported by node_modules/mqtt/lib/connect/tcp.js, but could not be resolved – treating it as an external dependency
'url' is imported by node_modules/mqtt/lib/connect/ws.js, but could not be resolved – treating it as an external dependency
'tls' is imported by node_modules/mqtt/lib/connect/tls.js, but could not be resolved – treating it as an external dependency
'net' is imported by net?commonjs-external, but could not be resolved – treating it as an external dependency
'tls' is imported by tls?commonjs-external, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/inherits/inherits.js, but could not be resolved – treating it as an external dependency
'util' is imported by util?commonjs-external, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules/mqtt/node_modules/readable-stream/lib/_stream_readable.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/mqtt/node_modules/readable-stream/lib/_stream_readable.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules/mqtt-packet/parser.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules/mqtt-packet/generate.js, but could not be resolved – treating it as an external dependency
'tty' is imported by node_modules/debug/src/node.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/debug/src/node.js, but could not be resolved – treating it as an external dependency
'tty' is imported by tty?commonjs-external, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/mqtt/node_modules/readable-stream/lib/internal/streams/stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/mqtt/node_modules/readable-stream/lib/internal/streams/BufferList.js, but could not be resolved – treating it as an external dependency
'os' is imported by node_modules/supports-color/index.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/util-deprecate/node.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules/safe-buffer/index.js, but could not be resolved – treating it as an external dependency
'os' is imported by os?commonjs-external, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules/core-util-is/lib/util.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by buffer?commonjs-external, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/duplexify/node_modules/readable-stream/readable.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules/bl/BufferList.js, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/readable-stream/readable.js, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/websocket-stream/node_modules/readable-stream/readable.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js, but could not be resolved – treating it as an external dependency
[...]
[core/servient] Servient caught Servient found error in privileged script 'dist/bundle.js' and halted with VMError: Error loading 'events'
When using external libraries, wam compilation phase complains with several warnings about circular dependencies even if the compilation ends and the bundle is created. Nevertheless, the bundle does not contain all the dependencies needed by the external library and so the application crashes. It seems that the problem occurs when importing a (nodejs) library in this way:
while instead there are no problems if importing the library in this way: