language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

vue-tsc finds errors, but returns `success`

Open TheDutchCoder opened this issue 10 months ago • 2 comments

Vue - Official extension or vue-tsc version

vue-tsc 2.2.0

VSCode version

N/A

Vue version

3.5.13

TypeScript version

5.7.3

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 163.03 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.0 - ~/.nvm/versions/node/v20.13.0/bin/node
    npm: 10.5.2 - ~/.nvm/versions/node/v20.13.0/bin/npm
    pnpm: 9.2.0 - ~/.nvm/versions/node/v20.13.0/bin/pnpm
  Browsers:
    Chrome: 132.0.6834.111
    Edge: 132.0.2957.127
    Safari: 18.2

package.json dependencies

{
  "devDependencies": {
    "@braze/web-sdk": "^5.6.1",
    "@floating-ui/vue": "^1.1.6",
    "@fortawesome/fontawesome-pro": "^6.7.2",
    "@fortawesome/free-brands-svg-icons": "^6.7.2",
    "@fortawesome/pro-duotone-svg-icons": "^6.7.2",
    "@fortawesome/pro-light-svg-icons": "^6.7.2",
    "@fortawesome/pro-regular-svg-icons": "^6.7.2",
    "@fortawesome/pro-solid-svg-icons": "^6.7.2",
    "@glidejs/glide": "^3.7.1",
    "@googlemaps/js-api-loader": "^1.16.8",
    "@mapbox/polyline": "^1.2.1",
    "@nuxt/devtools": "latest",
    "@nuxt/eslint": "^0.7.5",
    "@nuxt/test-utils": "^3.15.4",
    "@nuxtjs/device": "^3.2.4",
    "@nuxtjs/i18n": "^9.1.2",
    "@nuxtjs/robots": "^5.2.2",
    "@pqina/pintura": "^8.91.4",
    "@pqina/uppy-pintura": "^10.0.2",
    "@redis/client": "^1.6.0",
    "@segment/analytics-node": "^2.2.1",
    "@segment/public-api-sdk-typescript": "^56.0.0-b10238",
    "@sidebase/nuxt-auth": "^0.10.0",
    "@stripe/stripe-js": "^4.10.0",
    "@types/clone": "^2.1.4",
    "@types/glidejs__glide": "^3.6.5",
    "@types/google.maps": "^3.58.1",
    "@types/js-cookie": "^3.0.6",
    "@types/mapbox__polyline": "^1.0.5",
    "@types/ouibounce": "^0.0.4",
    "@types/qrcode": "^1.5.5",
    "@types/segment-analytics": "^0.0.38",
    "@types/ua-parser-js": "^0.7.39",
    "@types/uuid": "^10.0.0",
    "@types/yargs": "^17.0.33",
    "@typescript-eslint/rule-tester": "^8.18.0",
    "@typescript-eslint/utils": "^8.18.0",
    "@uppy/aws-s3": "^4.2.3",
    "@uppy/core": "^4.2.3",
    "@uppy/thumbnail-generator": "^4.1.1",
    "@uppy/utils": "^6.1.1",
    "@vesp/nuxt-fontawesome": "^1.2.0",
    "@vitest/eslint-plugin": "^1.1.25",
    "@vitest/coverage-v8": "^2.1.8",
    "@vue/test-utils": "^2.4.6",
    "@vuelidate/core": "^2.0.3",
    "@vuelidate/validators": "^2.0.4",
    "@vueuse/components": "^12.5.0",
    "@vueuse/core": "^12.5.0",
    "@vueuse/integrations": "^12.5.0",
    "@vueuse/nuxt": "^12.5.0",
    "browserslist": "^4.24.4",
    "citty": "^0.1.6",
    "clone": "^2.1.2",
    "configcat-node": "^11.3.1",
    "consola": "github:LekoArts/consola#prepare-script",
    "danger": "^12.3.3",
    "dayjs": "^1.11.13",
    "dd-trace": "^4.55.0",
    "dotenv-cli": "^8.0.0",
    "eslint": "^9.11.1",
    "eslint-plugin-perfectionist": "^4.6.0",
    "execa": "^9.5.2",
    "focus-trap": "^7.6.4",
    "happy-dom": "^15.11.7",
    "js-base64": "^3.7.7",
    "js-cookie": "^3.0.5",
    "json-schema-to-typescript": "^15.0.4",
    "lefthook": "^1.10.10",
    "nuxt": "^3.15.2",
    "nuxt-jsonld": "^2.1.0",
    "nuxt-open-fetch": "^0.9.5",
    "oidc-client-ts": "^3.1.0",
    "openapi-typescript": "^7.5.2",
    "ouibounce": "^0.0.12",
    "pino": "^9.5.0",
    "qrcode": "^1.5.4",
    "recaptcha-v3": "^1.11.3",
    "remove-attr": "^0.0.15",
    "sass-embedded": "^1.83.4",
    "timer-node": "^5.0.7",
    "tocbot": "^4.32.2",
    "ts-dedent": "^2.2.0",
    "tsx": "^4.19.2",
    "typescript": "^5.7.3",
    "ua-parser-js": "^2.0.0",
    "uuid": "^11.0.5",
    "v-calendar": "^3.1.2",
    "vite-svg-loader": "^5.1.0",
    "vitest": "^2.1.8",
    "vue": "^3.5.13",
    "vue-3-slider-component": "^1.0.1",
    "vue-bind-once": "^0.2.1",
    "vue-imask": "^7.6.0",
    "vue-observe-visibility": "^1.0.0",
    "vue-router": "^4.5.0",
    "vue-tel-input": "^9.3.0",
    "vue-tsc": "^2.2.0",
    "vuelidate": "^0.7.7",
    "yargs": "^17.7.2"
  },
  "optionalDependencies": {
    "@rollup/rollup-linux-x64-gnu": "4.31.0",
    "@rollup/rollup-win32-x64-msvc": "^4.31.0",
    "sass-embedded-linux-x64": "^1.83.1"
  }
}

Steps to reproduce

When I run vue-tsc on our Nuxt project, it clearly fins an error, but then returns successfully, which makes our pre-push hook pass, even though it should fail.

What is expected?

The process to throw when finding errors.

What is actually happening?

The process passes when finding errors.

Link to minimal reproduction

No response

Any additional comments?

Here's a screenshot of what happens:

Image

TheDutchCoder avatar Jan 27 '25 13:01 TheDutchCoder

I actually think it's just a false positive. getRouteBasename always returns a string, so the assigned value to pageSource is always a string, not sure why it thinks it can be undefined:

Image Image

So the Vue Language Tools seem to interpret this correctly, just the CLI version of vue-tsc doesn't.

TheDutchCoder avatar Jan 27 '25 13:01 TheDutchCoder

Having a similar issue. npx nuxi typecheck does not give out error code upon errors, so execution continues and i successfully commit not working code. When trying to run npx vue-tsc, the behavior is as expected (execution halts).

The issue is resolved on latest versions.

Image

Image

Foresteam avatar Feb 06 '25 03:02 Foresteam