无法读取属性' string'汇总结果中的不确定
我正在使用 Joi 包来验证和替换部分输入。 一切正常,但汇总后我不断收到:
TypeError: Cannot read property 'string' of undefined
指向:
internals$q.wrap = Joi.string()
.min(1)
.max(2)
.allow(false);
Joi import:
import Joi from 'joi';
dependency:
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"rollup-plugin-typescript2": "^0.31.2",
},
"dependencies": {
"joi": "^17.6.0"
}
rollup.config.json:
import typescript from 'rollup-plugin-typescript2';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import config from '../xxx.config.json'
import json from '@rollup/plugin-json'
export default config.Endpoints.map(endpoint => {
return {
input: endpoint,
output: [
{
dir: '../publish/',
format: 'cjs'
}
],
external: [
],
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: {
module: "es2015",
declaration: false
}
}
}),
resolve(),
commonjs(),
json(),
]
}
}
);
有人可以帮我吗?
谢谢。
我尝试升级 rollup 及其插件。
I'm using Joi package to validate and replace parts of the input.
Everything works ok but after the rollup I keep getting:
TypeError: Cannot read property 'string' of undefined
which point to:
internals$q.wrap = Joi.string()
.min(1)
.max(2)
.allow(false);
Joi import:
import Joi from 'joi';
dependencies:
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"rollup-plugin-typescript2": "^0.31.2",
},
"dependencies": {
"joi": "^17.6.0"
}
rollup.config.json:
import typescript from 'rollup-plugin-typescript2';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import config from '../xxx.config.json'
import json from '@rollup/plugin-json'
export default config.Endpoints.map(endpoint => {
return {
input: endpoint,
output: [
{
dir: '../publish/',
format: 'cjs'
}
],
external: [
],
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: {
module: "es2015",
declaration: false
}
}
}),
resolve(),
commonjs(),
json(),
]
}
}
);
Can someone help me with this?
Thanks.
I tried to upgrade rollup and it's plugins.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论