1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-12-26 21:52:49 +03:00
n8n/patches/typedi@0.10.0.patch
कारतोफ्फेलस्क्रिप्ट™ 0590ac7826
ci(core): Improve circular dependency reporting in typedi (no-changelog) (#8071)
## Summary
While backend development, this change explicitly logs the location and
index of a circular dependency, which helps getting rid of the circular
dependency.
2023-12-18 12:52:15 +01:00

15 lines
785 B
Diff

diff --git a/cjs/container-instance.class.js b/cjs/container-instance.class.js
index e473b1e652aa0b6e7462f7ba93fcef2812483b20..9e57857e5584373b88a9fad3fbb37bbcc56b554a 100644
--- a/cjs/container-instance.class.js
+++ b/cjs/container-instance.class.js
@@ -234,6 +234,9 @@ class ContainerInstance {
*/
initializeParams(target, paramTypes) {
return paramTypes.map((paramType, index) => {
+ if (paramType === undefined) {
+ throw new ReferenceError(`Circular dependency: Target${target.name}. Index: ${index} `);
+ }
const paramHandler = container_class_1.Container.handlers.find(handler => {
/**
* @Inject()-ed values are stored as parameter handlers and they reference their target