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

API break notification: crash in resolveTypeReferenceDirective #1421

Closed
RyanCavanaugh opened this issue Feb 24, 2022 · 4 comments
Closed

API break notification: crash in resolveTypeReferenceDirective #1421

RyanCavanaugh opened this issue Feb 24, 2022 · 4 comments
Labels

Comments

@RyanCavanaugh
Copy link

Reusing some bits here

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

See microsoft/TypeScript#48020

See also TypeStrong/ts-node#1647

@johnnyreilly
Copy link
Member

Thanks for the heads up - I wasn't aware of this issue.

I'm traveling at the moment and so only on my phone.

It looks like the issue has been addressed in ts-node already. Probably taking the following PR as a basis, we could implement something similar in ts-loader.

https://github.com/TypeStrong/ts-node/pull/1648/files

@johnnyreilly
Copy link
Member

I've dug a little further and it looks pretty likely that @cspotcode's work on ts-node will be reusable to solve this issue as well. Sidebar, it's interesting to note how both projects have some kind of TSCommon concept in play to handle differing versions of TypeScript APIs: https://github.com/TypeStrong/ts-node/pull/1648/files#diff-5bee04288d96530d8348a983e503ec21efdea399fb8b1a3aedb4bd51b03a6f5dR12

@stale
Copy link

stale bot commented Apr 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 28, 2022
@johnnyreilly
Copy link
Member

Closing as fixed - not sure what @stalebot is on about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants