TypeScript Error in Vue 3 mono-repo

UI Components for Vue
Post Reply
Stf_F
Posts: 2
Joined: 13 Dec 2021, 22:48

11 Jan 2022, 20:46

Hi,

I recently migrated a project to a mono repo using npm workspaces with Vue 3 and I am since getting TS errors on all PrimeVue components.

The errors are like so:

For the InputText component:

Code: Select all

JSX element class does not support attributes because it does not have a 'props' property.

Code: Select all

'__VLS_58' cannot be used as a JSX component. Its instance type 'InputText' is not a valid JSX element.
Or for the Button component:

Code: Select all

JSX element class does not support attributes because it does not have a 'props' property.

Code: Select all

'__VLS_44' cannot be used as a JSX component.  Its instance type 'Button' is not a valid JSX element.
My current folders structure is like so:

Code: Select all

| apps
| - api
| - ui     <---- Vue3 Codebase 
| -- src
| -- dist
| -- node_modules
| -- tsconfig.json
| node_modules
My current tsconfig.json:
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"composite": true,
"declaration": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": ["webpack-env", "jest"],
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": ["node_modules"]
}
I have tried to setup a base tsconfig at the root of the repo and extending it but it didn't do the trick:

tsconfig.base.json:

Code: Select all

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true
  },
  "include": ["./apps/ui/*"],
  "exclude": ["node_modules"]
}
Any help would be welcome.

Thanks

Stephane

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

24 Jan 2022, 08:42

Could you share your repo if possible?

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests