wzdwc / TexasPokerGame

This is an online Texas Hold'em game, base on TypeScript,egg,node,vue,javascript
97 stars 53 forks source link

client端在yarn dev时报错,是因为ts版本太高吗? #1

Closed lujiayou123 closed 2 years ago

lujiayou123 commented 2 years ago

2021-10-27 10:38:00,048 ERROR 25932 nodejs.TSError: ⨯ Unable to compile TypeScript: src/app/io/controller/game.ts(181,26): error TS2790: The operand of a 'delete' operator must be optional. src/app/io/controller/game.ts(284,18): error TS2790: The operand of a 'delete' operator must be optional. src/app/io/controller/game.ts(348,11): error TS2783: 'counter' is specified more than once, so this usage will be overwritten. src/app/io/controller/game.ts(349,11): error TS2783: 'buyIn' is specified more than once, so this usage will be overwritten. src/app/io/controller/game.ts(412,18): error TS2790: The operand of a 'delete' operator must be optional.

src/app/io/controller/game.ts(181,26): error TS2790: The operand of a 'delete' operator must be optional. src/app/io/controller/game.ts(284,18): error TS2790: The operand of a 'delete' operator must be optional. src/app/io/controller/game.ts(348,11): error TS2783: 'counter' is specified more than once, so this usage will be overwritten. src/app/io/controller/game.ts(349,11): error TS2783: 'buyIn' is specified more than once, so this usage will be overwritten. src/app/io/controller/game.ts(412,18): error TS2790: The operand of a 'delete' operator must be optional.

at createTSError (D:\Poker\TexasPokerGame\server\node_modules\midway-bin\node_modules\ts-node\src\index.ts:261:12)
at getOutput (D:\Poker\TexasPokerGame\server\node_modules\midway-bin\node_modules\ts-node\src\index.ts:367:40)
at Object.compile (D:\Poker\TexasPokerGame\server\node_modules\midway-bin\node_modules\ts-node\src\index.ts:558:11)
at Module.m._compile (D:\Poker\TexasPokerGame\server\node_modules\midway-bin\node_modules\ts-node\src\index.ts:439:43)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Object.require.extensions.<computed> [as .ts] (D:\Poker\TexasPokerGame\server\node_modules\midway-bin\node_modules\ts-node\src\index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)

diagnosticText: "src/app/io/controller/game.ts(181,26): error TS2790: The operand of a 'delete' operator must be optional.\r\nsrc/app/io/controller/game.ts(284,18): error TS2790: The operand of a 'delete' operator must be optional.\r\nsrc/app/io/controller/game.ts(348,11): error TS2783: 'counter' is specified more than once, so this usage will be overwritten.\r\nsrc/app/io/controller/game.ts(349,11): error TS2783: 'buyIn' is specified more than once, so this usage will be overwritten.\r\nsrc/app/io/controller/game.ts(412,18): error TS2790: The operand of a 'delete' operator must be optional.\r\n" diagnosticCodes: [2790,2790,2783,2783,2790]

lujiayou123 commented 2 years ago

说错了,是server端

wzdwc commented 2 years ago

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#operands-for-delete-must-be-optional image