-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
@typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedBugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
yarn init --yes
yarn add @types/[email protected]
With noImplicitAny
:
import * as acorn from "acorn/dist/acorn_loose";
Error:
Could not find a declaration file for module 'acorn/dist/acorn_loose'. 'c:/Users/Daniel/sample/node_modules/acorn/dist/acorn_loose.js' implicitly has an 'any' type.
Try `npm install @types/acorn` if it exists or add a new declaration (.d.ts) file containing `declare module 'acorn';`
But @types/acorn
already has been installed. The true error is that the declaration files haven't been written for this deeper import. I think we can give a better error message here.
Metadata
Metadata
Assignees
Labels
@typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedBugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingFixedA PR has been merged for this issueA PR has been merged for this issue