v4 beta4 @midwayjs/validatio zod 报错 #4416
Closed
desonyuan
started this conversation in
General / 闲聊
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
import { MidwayConfig } from '@midwayjs/core';
import * as zod from '@midwayjs/validation-zod';
export default {
// use for cookie sign key, should change to your own and keep security
keys: '1756958228768_2713',
koa: {
port: 7001,
},
validation: {
// 配置验证器
validators: {
zod,
},
// 设置默认验证器
defaultValidator: 'zod',
},
} as MidwayConfig;
D:\project\work\nextjs-projiect\zulihe\server\node_modules@midwayjs\validation\dist\registry.js:39
validator.validateService = await validator.validateServiceHandler(container);
^
TypeError: validator.validateServiceHandler is not a function
import *全量导入导致的,文档似乎要更新一下
import zod from '@midwayjs/validation-zod';
Beta Was this translation helpful? Give feedback.
All reactions