quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.77k stars 3.5k forks source link

vue-tsc Type 'string' is not assignable to type 'number' #17537

Closed mhy-beta closed 3 hours ago

mhy-beta commented 13 hours ago

What happened?

I create a new quasar project. I add a vertical separator to index.vue. Then I add a few more to create a menu with . However, I encounter a typescript type error every time.

ERROR(vue-tsc) Type 'string' is not assignable to type 'number'.

What did you expect to happen?

Works without TypeScript errors.

Reproduction URL

https://codesandbox.io/p/devbox/github/quasarframework/quasar-codesandbox/tree/master

How to reproduce?

  1. Open WebStorm v 2024.2 ( Build #WS-242.20224.342, built on August 9, 2024 )
  2. Use in terminal
  3. Bun create quasar / I try before yarn instead bun = nothing change quasar-create
  4. Open new quasar project from WebStorm
  5. Open package.json and run "lint"
  6. Run "dev"
  7. Automatic open Chrome (default browser) and press F12 to show DevTools
  8. Open quasar-project/pages/IndexPage.vue file from WebStorm
  9. Add to 9.line
  10. goto quasar website and "https://quasar.dev/vue-components/list-and-list-items" looking "Usage" and copy paste code samples.
  11. Change a little bit
  12. Result is Ekran görüntüsü 2024-09-25 010450

Code screen: Ekran görüntüsü 2024-09-25 010339

  1. Press Save shortcut "Ctrl+S" and look WebStorm Debug panel show Process Console.
  2. Show this "[vue-tsc] Found 4 errors. Watching for file changes. [ESLint] Found 0 error and 0 warning"
  3. Return the Chrome and result: quasar-chrome
  4. I tried it all from beginning to end with VSCode, and I get the same error there too.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

TypeScript Support

Platforms/Browsers

Chrome

Quasar info output

Operating System - Windows_NT(10.0.22631) - win32/x64
NodeJs - 20.14.0

Global packages
  NPM - 10.8.3
  yarn - 1.22.22
  @quasar/cli - 2.4.1
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.17.0 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.10.0 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.16.12 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.5.8 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.4.5
  pinia - 2.2.2 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 2.9.18 -- Native-ESM powered web dev build tool
  eslint - 8.57.1 -- An AST-based pattern checker for JavaScript.
  electron - Not installed
  electron-packager - Not installed
  @electron/packager - Not installed
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - *****pc
  Ethernet - 192.168.1.9

Relevant log output

No response

Additional context

I am also talking about WebStorm. I am also constantly getting the volar-ts error.

I also tried to update the steps with "codesandbox" and vsCode plugin, but it does not work even though I forked Quasar. UI gives an error in compilation. So codesandbox don't work.

I tested VS Code version: Version: 1.93.1 (user setup) Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 Date: 2024-09-11T17:20:05.685Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631

yusufkandemir commented 3 hours ago

:active-class="text-orange" is wrong, you shouldn't use the : prefix which is a shortcut for v-bind:, which binds to a variable. But, text-orange is not a variable, it's just text. So, use active-class"text-orange" as shown in the docs. I also suggest checking out the Vue docs.

As for inset-level, as mentioned in the docs, it should be a number. inset-level=5 is equal to inset-level="5" which binds a string. If you do :inset-level="5", it would be bound as a number and work correctly.

See https://vuejs.org/api/built-in-directives.html#v-bind