From 8e1fef4ba6b1dfcc64b575a78a282777a922573a Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 12 May 2026 19:46:07 +0300 Subject: [PATCH] force resolve esm version of zod --- package.json | 2 +- pnpm-lock.yaml | 2 +- webpack.config.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7cc235d6bb..5258433f5b 100644 --- a/package.json +++ b/package.json @@ -241,7 +241,7 @@ "tlds": "^1.234.0", "tldts": "^6.1.46", "unicode-segmenter": "^0.14.5", - "zod": "^3.20.2" + "zod": "^3.25.76" }, "devDependencies": { "@babel/core": "^7.26.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f82f534851..3e0789355a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -506,7 +506,7 @@ importers: specifier: 0.14.5 version: 0.14.5 zod: - specifier: ^3.20.2 + specifier: ^3.25.76 version: 3.25.76 devDependencies: '@babel/core': diff --git a/webpack.config.js b/webpack.config.js index 37c110c7bb..15667f3960 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -30,6 +30,9 @@ module.exports = async function (env, argv) { 'unicode-segmenter/grapheme': require .resolve('unicode-segmenter/grapheme') .replace(/\.cjs$/, '.js'), + // Force ESM version - zod's main/exports.require point to index.cjs which + // Expo's webpack config treats as a static asset, breaking `require('zod')` + zod$: require.resolve('zod').replace(/\.cjs$/, '.js'), 'react-native-gesture-handler': false, // RNGH should not be used on web, so let's cause a build error if it sneaks in '@sentry-internal/replay': false, // not used, ~300kb of dead weight })