fix(core): Ensure single zod instance across workspace packages#28604
Merged
lucamattiazzi merged 5 commits intomasterfrom Apr 20, 2026
Merged
fix(core): Ensure single zod instance across workspace packages#28604lucamattiazzi merged 5 commits intomasterfrom
lucamattiazzi merged 5 commits intomasterfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 5 files
Architecture diagram
sequenceDiagram
participant Registry as ModuleRegistry
participant Loader as NodeJS import()
participant Zod as Shared Zod Instance
participant Mod as Module (Primary/EE)
participant Err as MissingModuleError
Note over Registry,Zod: Module Initialization & Zod Singleton Enforcement
loop for each moduleName
Registry->>Loader: import(primaryPath)
activate Loader
Loader->>Zod: Resolve Zod Reference
Note over Loader,Zod: CHANGED: peerDependencies ensure<br/>workspace-wide singleton instance
alt Primary module exists
Loader->>Mod: Initialize
Mod-->>Loader: Module Exports
Loader-->>Registry: Success (Continue loop)
else NEW: Error is NOT 'MODULE_NOT_FOUND'
Loader-->>Registry: Throw logic/syntax error
Registry->>Err: NEW: Wrap with full stack trace
Err-->>Registry: Detailed Error
Note right of Registry: PR fixes error suppression
else Primary module NOT found
Loader-->>Registry: MODULE_NOT_FOUND
deactivate Loader
Registry->>Loader: import(eePath)
activate Loader
alt EE module exists
Loader->>Mod: Initialize
Mod-->>Loader: Module Exports
Loader-->>Registry: Success
else EE module NOT found
Loader-->>Registry: MODULE_NOT_FOUND
Registry->>Err: Throw MissingModuleError
else NEW: EE load fails with logic error
Loader-->>Registry: Throw logic/syntax error
Registry->>Err: NEW: Report EE error instead of primary
end
deactivate Loader
end
end
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline
Memory consumption baseline with starter plan resources
docker-stats
Idle baseline with Instance AI module loaded
How to read this table
|
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/@n8n/backend-common/src/modules/module-registry.ts">
<violation number="1" location="packages/@n8n/backend-common/src/modules/module-registry.ts:99">
P1: Only fall back to EE import when the primary import is actually module-not-found; otherwise unexpected primary import errors can be silently masked.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Bundle ReportBundle size has no change ✅ Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
|
ivov
approved these changes
Apr 20, 2026
Member
ivov
left a comment
There was a problem hiding this comment.
Consider also pnpm overrides, in case some future transitive dep drags in a different zod version.
Merged
Contributor
|
Got released with |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ensures that zod always has the same version across all packages. Also fixes error message suppression in module import.
Since stable presents the bug, we might want to backport it.
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/CAT-2822
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)