cyberphani/MyReactApp :: 실패


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

답글 남기기