Skip to content

Can't find type definitions for external module #17558

@GDreyV

Description

@GDreyV

Commands I used:

ng new test
npm i --save vss-web-extension-sdk 

After that I added into tsconfig.json:

"types": [ "vss-web-extension-sdk" ]

and updated angular.json with:

"scripts": [ "node_modules/vss-web-extension-sdk/lib/VSS.SDK.js" ]

per documentation at https://angular.io/guide/using-libraries#library-typings and https://angular.io/guide/typescript-configuration#typescript-typings that's all I have to do to make it work. So I just add usage like VSS.init({}); into app.component.ts. But when I build it with

ng build

I'm facing an error:

src/app/app.component.ts:11:5 - error TS2304: Cannot find name 'VSS'.
11     VSS.init({});

I see that type definitions are presented in the module but ignored buy builder. I believe it's relaged to the ambient module declaration within vss-web-extension-sdk but not sure about that.
Angular CLI: 9.1.3
Node: 10.16.0
OS: win32 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions