You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/index.ts:843
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
t1.ts:7:17 - error TS2339: Property 'subset' does not exist on type 'MathType'.
Property 'subset' does not exist on type 'number'.
7 console.log(res.subset(math.index(1, 1)))
~~~~~~
at createTSError (/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/index.ts:843:12)
at reportTSError (/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/index.ts:847:19)
at getOutput (/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/index.ts:1057:36)
at Object.compile (/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/index.ts:1411:41)
at transformSource (/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/esm.ts:400:37)
at /Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/esm.ts:278:53
at async addShortCircuitFlag (/Users/felix/.nvm/versions/node/v18.4.0/lib/node_modules/ts-node/src/esm.ts:409:15)
at async ESMLoader.load (node:internal/modules/esm/loader:431:20)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:350:11)
at async link (node:internal/modules/esm/module_job:70:21) {
diagnosticCodes: [ 2339 ]
}
The text was updated successfully, but these errors were encountered:
The reason is that the method .subset() is only available on a Matrix, and the output of math.dotPow is currently not specific enough to know that it res is indeed a Matrix.
run js code, get the expected result: print 16
When I put the same js code in ts file
t1.ts file
and run
ts-node t1.ts
,but get the following output errors:
The text was updated successfully, but these errors were encountered: