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

Support TypeScript 5 extends array #214

Closed
1 task
Sparticuz opened this issue Mar 31, 2023 · 1 comment
Closed
1 task

Support TypeScript 5 extends array #214

Sparticuz opened this issue Mar 31, 2023 · 1 comment
Labels
enhancement New feature or request outdated

Comments

@Sparticuz
Copy link

Bug description

Seems to be because I'm using multiple extends in TS5

{
  "extends": [
    "@tsconfig/node18/tsconfig",
    "@tsconfig/strictest/tsconfig",
    "@tsconfig/esm/tsconfig"
  ]
}
  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array

  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
      at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
      at new NodeError (node:internal/errors:399:5)
      at validateString (node:internal/validators:163:11)
      at Object.isAbsolute (node:path:1161:5)
      at mn (file:///home/kyle/dev/backend/node_modules/get-tsconfig/dist/index.mjs:3:7866)
      at J (file:///home/kyle/dev/backend/node_modules/get-tsconfig/dist/index.mjs:3:8931)
      at an (file:///home/kyle/dev/backend/node_modules/get-tsconfig/dist/index.mjs:3:9946)
      at file:///home/kyle/dev/backend/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:1087
      at ModuleJob.run (node:internal/modules/esm/module_job:193:25)


node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
    at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at new NodeError (node:internal/errors:399:5)
    at validateString (node:internal/validators:163:11)
    at Object.isAbsolute (node:path:1161:5)
    at mn (file:///home/kyle/dev/backend/node_modules/get-tsconfig/dist/index.mjs:3:7866)
    at J (file:///home/kyle/dev/backend/node_modules/get-tsconfig/dist/index.mjs:3:8931)
    at an (file:///home/kyle/dev/backend/node_modules/get-tsconfig/dist/index.mjs:3:9946)
    at file:///home/kyle/dev/backend/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:1087
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Reproduction

I'm not sure if this is right, getting a different error, but here is my best effort.
See: tsconfig.json's extends array

https://stackblitz.com/edit/node-ahpfuq

Environment

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 10.33 GB / 15.48 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 19.8.1 - /home/linuxbrew/.linuxbrew/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.5.1 - /home/linuxbrew/.linuxbrew/bin/npm
  npmPackages:
    tsx: ^3.12.6 => 3.12.6

Can you work on a fix?

  • I’m interested in opening a pull request to address this issue.
@Sparticuz Sparticuz added bug Something isn't working pending triage labels Mar 31, 2023
@privatenumber privatenumber added bug Something isn't working enhancement New feature or request pending triage and removed pending triage bug Something isn't working labels Apr 1, 2023
@privatenumber
Copy link
Owner

This should be a feature request because array extends is a feature that was recently released in TypeScript 5, and not something we could consider during implementation.

Anyway, your get-tsconfig dependency is outdated. So you can just run pnpm upgrade get-tsconfig and it will work. The reproduction still fails on StackBlitz because it uses Node.js v1614.2, which doesn't have node:test.

@privatenumber privatenumber changed the title "path" must be a string Support TypeScript 5 extends array Apr 1, 2023
@privatenumber privatenumber removed bug Something isn't working pending triage labels Apr 1, 2023
kachick added a commit to kachick/wait-other-jobs that referenced this issue Aug 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request outdated
Projects
None yet
Development

No branches or pull requests

2 participants