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.
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.
Code: Select all
| apps
| - api
| - ui <---- Vue3 Codebase
| -- src
| -- dist
| -- node_modules
| -- tsconfig.json
| 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:{
"$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"]
}
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"]
}
Thanks
Stephane