Skip to content

References not refreshing when target folder is regenerated #20223

Description

@NoelAbrahams

TypeScript Version: 2.6 using tsserver.js from 9 November 2017

I keep running into cases where intellisense is failing (as discussed in #17351).

The root cause is one or more <reference> tags in a _references.ts are not updating when the target folder is deleted and then generated. In the image below, there is a red squiggle under file module.globals.d.ts in spite of it existing in the file system. The trigger for this spurious error originates from the fact that the folder bin is regenerated on every build.

Editing the file name, e.g. to globals2.d.ts, and correcting it back makes things work again.

This does not happen deterministically, i.e. on every build, but fails randomly, normally (I believe) when there there is a delay in regenerating the target file. For instance, when there is a build error, which means module.globals.d.ts does not exist for a minute or so. I think it might be a problem with how the file watcher deals with folders that are deleted and regenerated, but I think I'm using TS that includes fixes from PR #19786.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions