mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-11 13:15:28 +03:00
* add typedi * convert ActiveWorkflowRunner into an injectable service * convert ExternalHooks into an injectable service * convert InternalHooks into an injectable service * convert LoadNodesAndCredentials into an injectable service * convert NodeTypes and CredentialTypes into an injectable service * convert ActiveExecutions into an injectable service * convert WaitTracker into an injectable service * convert Push into an injectable service * convert ActiveWebhooks and TestWebhooks into an injectable services * handle circular references, and log errors when a circular dependency is found
12 lines
771 B
Diff
12 lines
771 B
Diff
diff --git a/cjs/container-instance.class.js b/cjs/container-instance.class.js
|
|
index e473b1e652aa0b6e7462f7ba93fcef2812483b20..1e2ac7e5cb7943f5226a2bc25fa83bee0470f90c 100644
|
|
--- a/cjs/container-instance.class.js
|
|
+++ b/cjs/container-instance.class.js
|
|
@@ -234,6 +234,7 @@ class ContainerInstance {
|
|
*/
|
|
initializeParams(target, paramTypes) {
|
|
return paramTypes.map((paramType, index) => {
|
|
+ if (paramType === undefined) throw new ReferenceError('Cannot inject an `undefined` dependency. Possibly a circular dependency detected');
|
|
const paramHandler = container_class_1.Container.handlers.find(handler => {
|
|
/**
|
|
* @Inject()-ed values are stored as parameter handlers and they reference their target
|