@grapecity/gcpdfviewer dependency issues

Posted by: jgregory on 22 September 2020, 10:43 pm EST

  • Posted 22 September 2020, 10:43 pm EST

    I have included @grapecity/gcpdfviewer within my react-app, and I am getting a huge list of exceptions I cant seem to resolve:

    i 「wdm」: Failed to compile.
    ✖ 「atl」: Checking finished with 176 errors
    [at-loader] ./node_modules/@types/react/index.d.ts:2963:14
    TS2300: Duplicate identifier 'LibraryManagedAttributes'.

    [at-loader] ./node_modules/@grapecity/gcpdfviewer/typings/vendor/react/react.d.ts:2972:13
    TS2717: Subsequent property declarations must have the same type. Property 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>'.

    [at-loader] ./node_modules/@grapecity/gcpdfviewer/typings/vendor/react/react.d.ts:2973:13
    TS2717: Subsequent property declarations must have the same type. Property 'abbr' must be of type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>', but here has type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>'.

    [at-loader] ./node_modules/@grapecity/gcpdfviewer/typings/vendor/react/react.d.ts:2974:13
    TS2717: Subsequent property declarations must have the same type. Property 'address' must be of type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>', but here has type 'DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>'.


  • Marked as Answer

    Replied 23 September 2020, 3:03 am EST

    Hi,

    We could not repro the problem, so if you could provide a sample which demonstrates the problem that might help.

    Attached is a test project that was created using React with Typescript, the viewer got added to the page w/out any issues. To run:
    yarn install
    yarn build
    yarn start

    All seems to work as expected.

    As a quick fix, you could try using the skipLibCheck option for the typescript compiler. If you are using tsconfig.json, you can specify it in compilerOptions, e.g.:

    {
    "compilerOptions": {
    "skipLibCheck": true
    }
    }


    A similar issue was discussed on stackoverflow, maybe that'll help:
    https://stackoverflow.com/questions/52399839/duplicate-identifier-librarymanagedattributes

    Thanks

    my-app-ts.zip
  • Replied 21 October 2020, 3:35 am EST

    As there were no replies for a while now, marking the last message as answer.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels