Skip to content

Duplicate suggestion diagnostics returned for import with missing types #28710

@mjbvz

Description

@mjbvz

TypeScript Version: 3.3.0-dev.20181128

Search Terms:

  • suggestion
  • errors
  • geterr

Code
In a node project:

$ npm install querystring

With a ts file:

import { stringify } from 'querystring'

stringify  

Bug:
Duplicate suggestion diagnostics are returned:

[Trace  - 10:48:04 AM] Event received: suggestionDiag (0).
Data: {
    "file": "/Users/matb/projects/san/src/components/index.ts",
    "diagnostics": [
        {
            "start": {
                "line": 1,
                "offset": 27
            },
            "end": {
                "line": 1,
                "offset": 40
            },
            "text": "Could not find a declaration file for module 'querystring'. '/Users/matb/projects/san/node_modules/querystring/index.js' implicitly has an 'any' type.\n  Try `npm install @types/querystring` if it exists or add a new declaration (.d.ts) file containing `declare module 'querystring';`",
            "code": 7016,
            "category": "suggestion"
        },
        {
            "start": {
                "line": 1,
                "offset": 27
            },
            "end": {
                "line": 1,
                "offset": 40
            },
            "text": "Could not find a declaration file for module 'querystring'. '/Users/matb/projects/san/node_modules/querystring/index.js' implicitly has an 'any' type.\n  Try `npm install @types/querystring` if it exists or add a new declaration (.d.ts) file containing `declare module 'querystring';`",
            "code": 7016,
            "category": "suggestion"
        }
    ]
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions