Skip to content

Commit d983af9

Browse files
chore(deps): update dependency zod to v4 (v3) (#4523)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benjamin Canac <[email protected]>
1 parent 1db21d1 commit d983af9

File tree

6 files changed

+60
-51
lines changed

6 files changed

+60
-51
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"valibot": "^1.1.0",
4343
"workers-ai-provider": "^0.7.2",
4444
"yup": "^1.6.1",
45-
"zod": "^3.25.76"
45+
"zod": "^4.0.5"
4646
},
4747
"devDependencies": {
4848
"wrangler": "^4.24.3"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
"valibot": "^1.0.0",
178178
"vue-router": "^4.5.0",
179179
"yup": "^1.6.0",
180-
"zod": "^3.24.0"
180+
"zod": "^3.24.0 || ^4.0.0"
181181
},
182182
"peerDependenciesMeta": {
183183
"@inertiajs/vue3": {

playground-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@nuxt/ui": "workspace:*",
1414
"vue": "^3.5.17",
1515
"vue-router": "^4.5.1",
16-
"zod": "^3.25.76"
16+
"zod": "^4.0.5"
1717
},
1818
"devDependencies": {
1919
"@vitejs/plugin-vue": "^5.2.4",

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@nuxt/ui": "workspace:*",
1616
"@nuxthub/core": "^0.9.0",
1717
"nuxt": "^3.17.7",
18-
"zod": "^3.25.76"
18+
"zod": "^4.0.5"
1919
},
2020
"devDependencies": {
2121
"typescript": "^5.8.3",

pnpm-lock.yaml

Lines changed: 44 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/components/Form.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,24 +212,24 @@ describe('Form', () => {
212212
await form.value.submit()
213213

214214
expect(form.value.errors).toMatchObject([
215-
{ id: 'emailInput', name: 'email', message: 'Required' },
216-
{ id: 'passwordInput', name: 'password', message: 'Required' }
215+
{ id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' },
216+
{ id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' }
217217
])
218218

219219
expect(wrapper.setupState.onSubmit).not.toHaveBeenCalled()
220220
expect(wrapper.setupState.onError).toHaveBeenCalledTimes(1)
221221
expect(wrapper.setupState.onError).toHaveBeenCalledWith(expect.objectContaining({
222222
errors: [
223-
{ id: 'emailInput', name: 'email', message: 'Required' },
224-
{ id: 'passwordInput', name: 'password', message: 'Required' }
223+
{ id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' },
224+
{ id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' }
225225
]
226226
}))
227227

228228
const emailField = wrapper.find('#emailField')
229-
expect(emailField.text()).toBe('Required')
229+
expect(emailField.text()).toBe('Invalid input: expected string, received undefined')
230230

231231
const passwordField = wrapper.find('#passwordField')
232-
expect(passwordField.text()).toBe('Required')
232+
expect(passwordField.text()).toBe('Invalid input: expected string, received undefined')
233233
})
234234

235235
test('validate on submit works', async () => {
@@ -267,8 +267,8 @@ describe('Form', () => {
267267
const errors = form.value.getErrors()
268268

269269
expect(errors).toMatchObject([
270-
{ id: 'emailInput', name: 'email', message: 'Required' },
271-
{ id: 'passwordInput', name: 'password', message: 'Required' }
270+
{ id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' },
271+
{ id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' }
272272
])
273273
})
274274

@@ -424,14 +424,14 @@ describe('Form', () => {
424424
expect(wrapper.setupState.onSubmit).not.toHaveBeenCalled()
425425
expect(wrapper.setupState.onError).toHaveBeenCalledTimes(1)
426426
const onErrorCallArgs = wrapper.setupState.onError.mock.lastCall[0]
427-
expect(onErrorCallArgs.children[0].errors).toMatchObject([{ id: 'nestedInput', name: 'field', message: 'Required' }])
427+
expect(onErrorCallArgs.children[0].errors).toMatchObject([{ id: 'nestedInput', name: 'field', message: 'Invalid input: expected string, received undefined' }])
428428
expect(onErrorCallArgs.errors).toMatchObject([
429-
{ id: 'emailInput', name: 'email', message: 'Required' },
430-
{ id: 'passwordInput', name: 'password', message: 'Required' }
429+
{ id: 'emailInput', name: 'email', message: 'Invalid input: expected string, received undefined' },
430+
{ id: 'passwordInput', name: 'password', message: 'Invalid input: expected string, received undefined' }
431431
])
432432

433433
const nestedField = wrapper.find('#nestedField')
434-
expect(nestedField.text()).toBe('Required')
434+
expect(nestedField.text()).toBe('Invalid input: expected string, received undefined')
435435
})
436436

437437
test('submit event contains nested attributes', async () => {

0 commit comments

Comments
 (0)