Skip to content

API break notification: crash in resolveTypeReferenceDirective #1647

Closed
@RyanCavanaugh

Description

@RyanCavanaugh

Search Terms

path indexOf charCodeAt resolveTypeReferenceDirective typescript 4.7

Expected Behavior

No crash

Actual Behavior

/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:7690
        var index = path.indexOf("\\");
                         ^
TypeError: path.indexOf is not a function
    at normalizeSlashes (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:7690:26)
    at Object.combinePaths (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:7756:28)
    at /home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:41927:40
    at Object.firstDefined (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:407:26)
    at primaryLookup (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:41926:27)
    at Object.resolveTypeReferenceDirective (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:41885:24)
    at /home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/ts-node/src/resolver-functions.ts:135:14
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/ts-node/src/resolver-functions.ts:133:33)
    at actualResolveTypeReferenceDirectiveNamesWorker 

Steps to reproduce the problem

Install ts-node and typescript@next

test.ts

/// <reference types="blah" />

This is due to the signature of resolveTypeReferenceDirectives changing; see microsoft/TypeScript#47732

See also microsoft/TypeScript#47921

Specifications

  • ts-node version: latest
  • node version: latest
  • TypeScript version: 4.7 (nightly)
  • tsconfig.json, if you're using one:
{}
  • Operating system and version: Unknown
  • If Windows, are you using WSL or WSL2?:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions