Skip to content

Typescript error This expression is not callable in config with module: nodnext and vue-tsc #487

Open
@silverwind

Description

@silverwind

Related plugins

Describe the bug

When typescript module is nodenext, vue-tsc produces this error coming from this plugin:

vitest.config.ts:6:5 - error TS2349: This expression is not callable.
  Type 'typeof import("node_modules/@vitejs/plugin-vue/dist/index")' has no call signatures.

6     vuePlugin(),
      ~~~~~~~~~

Changing module to preserve works, but is undesirable in Node.js projects. Changing module to esnext also works but resolveJsonModule can not be used with it so is also not desirable.

Using official tsc instead of vue-tsc also works, but that breaks the typechecking of all .vue files, so also not desirable.

This might be a bug in vue-tsc, if so let me know and I will file it there.

Reproduction

https://github.com/silverwind/vue-plugin-not-callable

Steps to reproduce

Run npm i && npx tsc

System Info

"@vitejs/plugin-vue": "5.2.1",
"typescript": "5.6.3",
"vue-tsc": "2.1.10"

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions