반응형
https://github.com/cyberphani/MyReactApp
npx create-react-app . --template typescript
npm install typescript @types/node @types/react @types/react-dom @types/jest
npm i @sinclair/typebox
TypeScript error in C:/VIW/MyReactApp-master/web/node_modules/@sinclair/typebox/typebox.d.ts(349,42):
'?' expected. TS1005
347 | export type TTemplateLiteralConst<T, Acc extends string> = T extends TUnion<infer U> ? {
348 | [K in keyof U]: TTemplateLiteralUnion<Assert<[U[K]], TTemplateLiteralKind[]>, Acc>;
> 349 | }[number] : T extends TTemplateLiteral ? `${Static<T>}` : T extends TLiteral<infer U> ? `${U}` : T extends TString ? `${string}` : T extends TNumber ? `${number}` : T extends TBigInt ? `${bigint}` : T extends TBoolean ? `${boolean}` : never;
| ^
350 | export type TTemplateLiteralUnion<T extends TTemplateLiteralKind[], Acc extends string = ''> = T extends [infer L, ...infer R] ? `${TTemplateLiteralConst<L, Acc>}${TTemplateLiteralUnion<Assert<R, TTemplateLiteralKind[]>, Acc>}` : T extends [infer L] ? `${TTemplateLiteralConst<L, Acc>}${Acc}` : Acc;
351 | export interface TTemplateLiteral<T extends TTemplateLiteralKind[] = TTemplateLiteralKind[]> extends TSchema {
352 | [Kind]: 'TemplateLiteral';
package를 특정 버전으로 설치해야함.
npm install typescript@4.1.6
npm install -D @types/express-serve-static-core@4.17.3
오류
C:/VIW/MyReactApp-master/web/node_modules/@types/jest/index.d.ts
TypeScript error in C:/VIW/MyReactApp-master/web/node_modules/@types/jest/index.d.ts(1238,40):
',' expected. TS1005
1236 | * Constructs the type of a spied class.
1237 | */
> 1238 | type SpiedClass<T extends abstract new (...args: any) => any> = SpyInstance<
| ^
1239 | InstanceType<T>,
1240 | ConstructorParameters<T>,
1241 | T extends abstract new (...args: any) => infer C ? C : never
타입스크립트 다시 설치.
yarn add typescript @types/node @types/react @types/react-dom @types/jest
오류
Cannot find type definition file for 'color-name'.
The file is in the program because:
Entry point for implicit type library 'color-name'
tsconfig.json 수정
"types": ["node"] 추가
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"types": ["node"]
},
}
오류 발생
TypeScript error in C:/VIW/MyReactApp-master/web/src/modules/department/components/DepartmentForm.tsx(61,16):
JSX element type 'Form' does not have any construct or call signatures. TS2604
59 | renderForm = (formik: FormikProps<any>) => (
60 | <div className={'form'}>
> 61 | <Form onSubmit={formik.handleSubmit}>
| ^
62 | <Form.Group widths='equal'>
63 | <Form.Input
64 | name='dName' fluid
반응형
'개발정보' 카테고리의 다른 글
mg3-codes/d-d-spell-finder :: 성공 (0) | 2023.07.19 |
---|---|
sahil-bhanvadiya/ag-grid-react-redux-typescript :: 성공 (0) | 2023.07.19 |
'NODE'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 (0) | 2023.07.19 |
리눅스 디스크 용량 체크 방법 (0) | 2023.07.19 |
리눅스 톰캣 실행 확인 (0) | 2023.07.17 |