Closed DenisCarriere closed 2 years ago
You need to set your typescript target to es2020 or lower.
See https://github.com/microsoft/TypeScript/issues/44429 for more info
🙇♂️ Thanks, it worked!
Changed "target": "es2020"
in tsconfig.json
$ ts-node index.ts
{
account: Name { value: UInt64 { value: [BN] } },
name: Name { value: UInt64 { value: [BN] } },
authorization: [ PermissionLevel { actor: [Name], permission: [Name] } ],
data: Bytes {
array: Uint8Array(36) [
0, 0, 200, 83, 83, 132, 140, 151, 0,
0, 200, 83, 83, 132, 12, 205, 16, 39,
0, 0, 0, 0, 0, 0, 4, 69, 79,
83, 0, 0, 0, 0, 3, 102, 111, 111
]
}
}
tsconfig.json
{
"compilerOptions": {
"target": "es2020",
"moduleResolution": "node",
"experimentalDecorators": true
}
}
Code seems to be working in the browser, however executing it locally with
ts-node index.ts
throws the following error:Code Example
https://stackblitz.com/edit/typescript-i1q86h
Code snippet