在发生这种情况之前,我在本机脚本项目方面取得了良好进展:
JS: EXCEPTION: Uncaught (in promise): ReferenceError: __assign is not defined
这是从这行代码冒出来的:
return [...state, { ...action.payload, success: false }];
这是我的tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true
},
"exclude": [
"node_modules",
"platforms",
"**/*.aot.ts"
]
}
Typescript 似乎没有__assign
在编译的源代码中包含它的辅助函数——这是他们实现对象扩展语法的方式。你们中的任何一个好人会碰巧知道为什么吗?