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 #1647

Closed
RyanCavanaugh opened this issue Feb 17, 2022 · 0 comments · Fixed by #1648
Closed

API break notification: crash in resolveTypeReferenceDirective #1647

RyanCavanaugh opened this issue Feb 17, 2022 · 0 comments · Fixed by #1648
Labels
Milestone

Comments

@RyanCavanaugh
Copy link

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?:
@cspotcode cspotcode added the bug label Feb 17, 2022
@cspotcode cspotcode added this to the 10.6.0 milestone Feb 17, 2022
bluelovers added a commit to bluelovers/idea-l10n-zht that referenced this issue Feb 18, 2022
@cspotcode cspotcode mentioned this issue Feb 19, 2022
cspotcode added a commit that referenced this issue Feb 19, 2022
* fix

* Fix

* fix
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Mar 8, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ts-node](https://typestrong.org/ts-node) ([source](https://github.com/TypeStrong/ts-node)) | devDependencies | minor | [`10.5.0` -> `10.6.0`](https://renovatebot.com/diffs/npm/ts-node/10.5.0/10.6.0) |

---

### Release Notes

<details>
<summary>TypeStrong/ts-node</summary>

### [`v10.6.0`](https://github.com/TypeStrong/ts-node/releases/v10.6.0)

[Compare Source](TypeStrong/ts-node@v10.5.0...v10.6.0)

Questions about this release? Ask in the official discussion thread: [#&#8203;1666](TypeStrong/ts-node#1666)

**Added**

-   Adds workaround for extensionless entrypoints with ESM loader ([#&#8203;1649](TypeStrong/ts-node#1649), [#&#8203;1654](TypeStrong/ts-node#1654))
    -   You can now combine tools such as `mocha` with `--loader ts-node/esm`, where previously node would throw `[ERR_UNKNOWN_FILE_EXTENSION]`
    -   node has a bug where combining `--loader` with an extensionless entrypoint causes this error [nodejs/node#&#8203;33226](nodejs/node#33226)
    -   Some tools, for example `mocha`, have an extensionless entrypoint. ([source](https://github.com/mochajs/mocha/blob/547ffd73535088322579d3d2026432112eae3d4b/package.json#L37), [source](https://github.com/mochajs/mocha/blob/547ffd73535088322579d3d2026432112eae3d4b/bin/mocha))
    -   Combining `NODE_OPTIONS=--loader ts-node/esm` with these tools causes this error.  [mochajs/mocha#&#8203;4645](mochajs/mocha#4645)
    -   node intends to fix this bug in a future release: [nodejs/node#&#8203;41711](nodejs/node#41711)
    -   In the interim, we have implemented a workaround in ts-node.
-   Adds support for target "ES2022" in `moduleTypes` overrides ([#&#8203;1650](TypeStrong/ts-node#1650))

**Fixed**

-   Fixed bug where `--swc` and other third-party transpilers did not respect `moduleTypes` overrides ([#&#8203;1651](TypeStrong/ts-node#1651), [#&#8203;1652](TypeStrong/ts-node#1652), [#&#8203;1660](TypeStrong/ts-node#1660))
-   Fixed bug where node flags were not preserved correctly in `process.execArgv` ([#&#8203;1657](TypeStrong/ts-node#1657), [#&#8203;1658](TypeStrong/ts-node#1658))
    -   This affected `child_process.fork()`, since it uses `process.execArgv` to create a similar child runtime.
    -   With this fix, `child_process.fork()` will preserve both node flags and `ts-node` hooks.
-   Fixed compatibility TypeScript 4.7's API changes ([#&#8203;1647](TypeStrong/ts-node#1647), [#&#8203;1648](TypeStrong/ts-node#1648))

https://github.com/TypeStrong/ts-node/milestone/9

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <[email protected]>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1195
Reviewed-by: Epsilon_02 <[email protected]>
Co-authored-by: Calciumdibromid Bot <[email protected]>
Co-committed-by: Calciumdibromid Bot <[email protected]>
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