Skip to content

Commit 729e794

Browse files
committed
fix(build): declare @strapi/utils as peerDependency — preventive zod/v4 fix
Preventive companion to the magic-link runtime crash fix. Session Manager did not yet crash at runtime but had the same structural issue: @strapi/utils was being inlined into dist/server/index.js, and @strapi/utils now internally does require('zod/v4'). With zod pinned to ^3.x on the host the import resolves to undefined and z.string() crashes. Adding @strapi/utils to peerDependencies tells pack-up to emit require('@strapi/utils') at runtime instead of copying the library into the bundle. Impact: - dist/server/index.js: 52,009 -> 13,817 lines - zero require('zod/v4') in bundle - @strapi/utils loaded at runtime from Strapi host - lockfile regenerated with npm install --no-workspaces
1 parent b165368 commit 729e794

3 files changed

Lines changed: 33 additions & 78 deletions

File tree

.externals.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"externals": [
3+
"react",
4+
"react-dom",
5+
"react-router-dom",
6+
"react-intl",
7+
"styled-components",
8+
"@strapi/strapi",
9+
"@strapi/utils",
10+
"@strapi/design-system",
11+
"@strapi/icons"
12+
],
13+
"output": {
14+
"globals": {
15+
"react": "React",
16+
"react-dom": "ReactDOM",
17+
"react-router-dom": "ReactRouterDom",
18+
"react-intl": "ReactIntl",
19+
"styled-components": "styled",
20+
"@strapi/strapi": "Strapi",
21+
"@strapi/utils": "StrapiUtils",
22+
"@strapi/design-system": "StrapiDesignSystem",
23+
"@strapi/icons": "StrapiIcons"
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)