Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: path.indexOf is not a function in github actions #47921

Closed
bluelovers opened this issue Feb 16, 2022 · 5 comments
Closed

TypeError: path.indexOf is not a function in github actions #47921

bluelovers opened this issue Feb 16, 2022 · 5 comments
Assignees
Labels
API Relates to the public API for TypeScript Breaking Change Would introduce errors in existing code External Relates to another program, environment, or user action which we cannot control.

Comments

@bluelovers
Copy link
Contributor

https://github.com/bluelovers/ws-rest/runs/5221176096?check_suite_focus=true

/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:7690
        var index = path.indexOf("\\");
                         ^
TypeError: path.indexOf is not a function
    at normalizeSlashes (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:7690:26)
    at Object.combinePaths (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:7756:28)
    at /home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:41927:40
    at Object.firstDefined (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:407:26)
    at primaryLookup (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:41926:27)
    at Object.resolveTypeReferenceDirective (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:41885:24)
    at /home/runner/.config/yarn/global/node_modules/ts-node/src/resolver-functions.ts:135:14
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/home/runner/.config/yarn/global/node_modules/ts-node/src/resolver-functions.ts:133:33)
    at actualResolveTypeReferenceDirectiveNamesWorker (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:11[49](https://github.com/bluelovers/ws-rest/runs/5221176096?check_suite_focus=true#step:5:49)19:163)
    at resolveTypeReferenceDirectiveNamesWorker (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:11[51](https://github.com/bluelovers/ws-rest/runs/5221176096?check_suite_focus=true#step:5:51)85:26)
    at processTypeReferenceDirectives (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:116660:31)
    at findSourceFileWorker (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:116[54](https://github.com/bluelovers/ws-rest/runs/5221176096?check_suite_focus=true#step:5:54)5:21)
    at findSourceFile (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:116407:26)
    at processImportedModules (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:116806:25)
    at findSourceFileWorker (/home/runner/.config/yarn/global/node_modules/typescript/lib/typescript.js:116[55](https://github.com/bluelovers/ws-rest/runs/5221176096?check_suite_focus=true#step:5:55)1:17)

https://github.com/bluelovers/idea-l10n-zht/runs/5216786455?check_suite_focus=true

/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 (/home/runner/work/idea-l10n-zht/idea-l10n-zht/node_modules/typescript/lib/typescript.js:114919:163)
@jakebailey
Copy link
Member

I was able to reproduce it by using the latter of the above repos and just tweaking the typescript version; the issue was introduced in between 4.7.0-dev.20220215 and 4.7.0-dev.20220216.

@RyanCavanaugh
Copy link
Member

The call stack points to #47732

@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.6.1 milestone Feb 17, 2022
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Feb 17, 2022
@weswigham
Copy link
Member

Whilst I can technically fix this by making resolveTypeReferenceDirective accept a FileReference just like resolveTypeReferenceDirectives does now due to the structure of the code in ts-node, the issue is actually in ts-node - we changed the signature of resolveTypeReferenceDirectives and their override signature has yet to be updated to match.

@RyanCavanaugh RyanCavanaugh added External Relates to another program, environment, or user action which we cannot control. and removed Bug A bug in TypeScript labels Feb 17, 2022
@RyanCavanaugh RyanCavanaugh added the Breaking Change Would introduce errors in existing code label Feb 17, 2022
@cspotcode
Copy link

Thanks, agreed this needs to be fixed in ts-node, we can close this ticket.

@typescript-bot
Copy link
Collaborator

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Relates to the public API for TypeScript Breaking Change Would introduce errors in existing code External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

7 participants