Код: Выделить всё
1. node_modules/zod/lib/helpers/util.d.ts:19:47 - error TS2339: Property 'isInteger' does not exist on type 'NumberConstructor'.
2. node_modules/zod/lib/types.d.ts:612:17 - error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later.
3. node_modules/zod/lib/types.d.ts:619:23 - error TS2583: Cannot find name 'Map'.
4. node_modules/zod/lib/types.d.ts:689:121 - error TS2583: Cannot find name 'Map'.
5. node_modules/zod/lib/types.d.ts:707:84 - error TS2583: Cannot find name 'Set'.
6. node_modules/zod/lib/types.d.ts:772:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
7. node_modules/zod/lib/types.d.ts:923:14 - error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.
8. node_modules/zod/lib/types.d.ts:925:34 - error TS2583: Cannot find name 'Map'.
import { z } from "zod";
const UserSchema = z.object({
username: z.string(),
});
const user = { username: "ddi" };
console.log(UserSchema.parse(user));
< /code>
Вопросы:
Что может привести к сбою TSC, в то время как TS-Node работает совершенно нормально?
Есть ли дополнительные настройки в tsconfig.json, я должен изменить, чтобы сделать TSC работает, как и ожидалось?>
Подробнее здесь: https://stackoverflow.com/questions/794 ... ap-set-and
Мобильная версия