Everything was going smoothly with my native-script project until I encountered this issue:
JS: EXCEPTION: Uncaught (in promise): ReferenceError: __assign is not defined
The error originates from this line of code:
return [...state, { ...action.payload, success: false }];
Take a look at my tsconfig.json
:
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true
},
"exclude": [
"node_modules",
"platforms",
"**/*.aot.ts"
]
}
It seems that Typescript is not including the helper function __assign
in the compiled source, which is necessary for implementing object spread syntax. Any insights on why this might be happening?