Skip to content

5.3.2 adds broken "reference" commentΒ #56571

Closed as not planned
Closed as not planned
@rchl

Description

@rchl

πŸ”Ž Search Terms

reference types error

πŸ•— Version & Regression Information

  • This changed between versions 5.2.2 and 5.3.2

⏯ Playground Link

No response

πŸ’» Code

My code does a type import like:

import type { ModuleOptions } from '../../module/module';

and in 5.3.2 this adds a type reference in the compiled output:

/// <reference types="dist/module/module" />

which is an invalid path from the point of the user of this package and result in an error:

node_modules/foo-package/dist/lib/dir/file.d.ts:4:23 - error TS2688: Cannot find type definition file for 'dist/module/module'.

4 /// <reference types="dist/module/module" />

πŸ™ Actual behavior

Adds a broken reference:

/// <reference types="dist/module/module" />

πŸ™‚ Expected behavior

5.2.2 didn't add a reference in this case.

Additional information about the issue

No response

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