Skip to content

Bug: Build fails on new projects due to incompatibility with [email protected] #181

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

Open
dkvc opened this issue Jun 14, 2025 · 3 comments
Labels
bug Something isn't working upstream

Comments

@dkvc
Copy link

dkvc commented Jun 14, 2025

Error

This issue affects all new Vue projects created with the standard scaffolding (pnpm create vue@latest) since the release of [email protected]. It can also be reproduced on existing projects by updating eslint from 9.28.0 to 9.29.0

The default eslint.config.ts generated by create-vue now fails during the vue-tsc --build step with a TS2345 type error.

Possible Cause

The API contract of defineConfigWithVueTs appears to be broken by the [email protected] release. The function expects a very specific object shape, but helper functions from the eslint package itself now return objects that no longer match that shape.

Here's the commit that contains the changes to FlatConfig in eslint: eslint/eslint@7ab77a2

Reproducing the Bug

  1. Run pnpm create vue@latest
  2. Select Typescript and ESLint Support.
  3. Run pnpm i. The latest version [email protected] will be installed.
  4. Run pnpm build.

Error Log

eslint.config.ts:18:3 - error TS2345: Argument of type 'Config<RulesRecord>' is not assignable to parameter of type 'InfiniteDepthConfigWithExtendsAndVueSupport'.
  Type 'Config<RulesRecord>' is not assignable to type 'ConfigItemWithExtendsAndVueSupport'.
    Types of property 'languageOptions' are incompatible.
      Type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/types/index").Linter.LanguageOptions | undefined' is not assignable to type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions | undefined'.
        Type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/types/index").Linter.LanguageOptions' is not assignable to type 'import("/mnt/e/Repos/test/test/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions'.
          Types of property 'ecmaVersion' are incompatible.
            Type 'EcmaVersion | undefined' is not assignable to type 'EcmaVersion'.
              Type '17' is not assignable to type 'EcmaVersion'.

18   globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Notes/Assumptions

I assume this is a type incompatibility between eslint and @typescript-eslint/utils.

type ConfigItem = TSESLint.FlatConfig.Config
type InfiniteDepthConfigWithExtendsAndVueSupport =
| TsEslintConfigForVue
| ConfigItemWithExtendsAndVueSupport
| InfiniteDepthConfigWithExtendsAndVueSupport[]
interface ConfigItemWithExtendsAndVueSupport extends ConfigItem {
extends?: InfiniteDepthConfigWithExtendsAndVueSupport[]
}

Here, ConfigItemWithExtendsAndVueSupport depends on ConfigItem, which further depends on TSESLint.FlatConfig.Config. Based on the error log, it appears LanguageOptions from @typescript-eslint/utils requires changes.

https://github.com/typescript-eslint/typescript-eslint/blob/de8943e98e188d83801ec1044ffc69451db1aa63/packages/utils/src/ts-eslint/Config.ts#L215-L252

@qiukeren
Copy link

it suddenly occurs today even not yesterday

from here, vue created projects have this problem, not only 9.28.0

    "eslint": "^9.22.0",

SHELL: npm run build
 
> [email protected] build
> run-p type-check "build-only {@}" --


> [email protected] build-only
> vite build


> [email protected] type-check
> vue-tsc --build

vite v6.3.5 building for production...
transforming (1) src/main.tseslint.config.ts:17:3 - error TS2345: Argument of type 'Config<RulesRecord>' is not assignable to parameter of type 'InfiniteDepthConfigWithExtendsAndVueSupport'.
  Type 'Config<RulesRecord>' is not assignable to type 'ConfigItemWithExtendsAndVueSupport'.
    Types of property 'languageOptions' are incompatible.
      Type 'import("/DIR/src/demo/src/main/index1/node_modules/eslint/lib/types/index").Linter.LanguageOptions | undefined' is not assignable to type 'import("/DIR/src/demo/src/main/index1/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions | undefined'.
        Type 'import("/DIR/src/demo/src/main/index1/node_modules/eslint/lib/types/index").Linter.LanguageOptions' is not assignable to type 'import("/DIR/src/demo/src/main/index1/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config").FlatConfig.LanguageOptions'.
          Types of property 'ecmaVersion' are incompatible.
            Type 'EcmaVersion | undefined' is not assignable to type 'EcmaVersion'.
              Type '17' is not assignable to type 'EcmaVersion'.

17   globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✓ 53 modules transformed.
dist/index.html                      0.43 kB │ gzip:  0.29 kB
dist/assets/AboutView-CSIvawM9.css   0.09 kB │ gzip:  0.10 kB
dist/assets/index-5dJgFXHu.css       4.21 kB │ gzip:  1.30 kB
dist/assets/AboutView-B6UJm9Jx.js    0.23 kB │ gzip:  0.21 kB
dist/assets/index-Pj5_I0LE.js       96.49 kB │ gzip: 37.94 kB
✓ built in 851ms

Found 1 error.

ERROR: "type-check" exited with 2.
SHELL:  cat package.json 
{
  "name": "index1",
  "version": "0.0.0",
  "private": true,
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "run-p type-check \"build-only {@}\" --",
    "preview": "vite preview",
    "build-only": "vite build",
    "type-check": "vue-tsc --build",
    "lint": "eslint . --fix",
    "format": "prettier --write src/"
  },
  "dependencies": {
    "pinia": "^3.0.1",
    "vue": "^3.5.13",
    "vue-router": "^4.5.0"
  },
  "devDependencies": {
    "@tsconfig/node22": "^22.0.1",
    "@types/node": "^22.14.0",
    "@vitejs/plugin-vue": "^5.2.3",
    "@vue/eslint-config-prettier": "^10.2.0",
    "@vue/eslint-config-typescript": "^14.5.0",
    "@vue/tsconfig": "^0.7.0",
    "eslint": "^9.22.0",
    "eslint-plugin-vue": "~10.0.0",
    "jiti": "^2.4.2",
    "npm-run-all2": "^7.0.2",
    "prettier": "3.5.3",
    "typescript": "~5.8.0",
    "vite": "^6.2.4",
    "vite-plugin-vue-devtools": "^7.7.2",
    "vue-tsc": "^2.2.8"
  }
}

@haoqunjiang haoqunjiang added the bug Something isn't working label Jun 16, 2025
@haoqunjiang
Copy link
Member

The fix is pending release: typescript-eslint/typescript-eslint#11304

@haoqunjiang
Copy link
Member

We release a latest version every Monday at 17:00 UTC (Tuesdays at 12:30 AM GMT+7:30) using the latest commit to main at that time. This release is performed automatically by a Github action located in a private repository. This release goes to the standard latest tag on npm.

It will be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

3 participants