Im using Nuxt 3, mostly default settings.
My folder structure for a component:
<code>...
├── components
│ ├── MainNav.vue
│ ├── PageHeader.vue
│ ├── data-table
│ │ ├── DataTable.vue
│ │ └── index.ts
</code>
<code>...
├── components
│ ├── MainNav.vue
│ ├── PageHeader.vue
│ ├── data-table
│ │ ├── DataTable.vue
│ │ └── index.ts
</code>
...
├── components
│ ├── MainNav.vue
│ ├── PageHeader.vue
│ ├── data-table
│ │ ├── DataTable.vue
│ │ └── index.ts
My index.ts
:
<code>export { default as DataTable } from "./DataTable.vue";
</code>
<code>export { default as DataTable } from "./DataTable.vue";
</code>
export { default as DataTable } from "./DataTable.vue";
I keep getting this vue-tsc
error (below)… What am I doing that’s dumb? After hours of searching I can only find very outdated Nuxt 2 answers.
I have tried a bunch of attempts at adding paths to my to no avail…
My nuxt.config.ts
<code> typescript: {
strict: true,
typeCheck: true,
tsConfig: {
compilerOptions: {
paths: {
"~/*": ["./*"],
"@/*": ["./*"],
},
},
},
},
</code>
<code> typescript: {
strict: true,
typeCheck: true,
tsConfig: {
compilerOptions: {
paths: {
"~/*": ["./*"],
"@/*": ["./*"],
},
},
},
},
</code>
typescript: {
strict: true,
typeCheck: true,
tsConfig: {
compilerOptions: {
paths: {
"~/*": ["./*"],
"@/*": ["./*"],
},
},
},
},
<code> ERROR 5:26:26 AM
ERROR(vue-tsc) Cannot find module './DataTable.vue' or its corresponding type declarations.
FILE .../components/data-table/index.ts:1:38
> 1 | export { default as DataTable } from "./DataTable.vue";
| ^^^^^^^^^^^^^^^^^
2 |
</code>
<code> ERROR 5:26:26 AM
ERROR(vue-tsc) Cannot find module './DataTable.vue' or its corresponding type declarations.
FILE .../components/data-table/index.ts:1:38
> 1 | export { default as DataTable } from "./DataTable.vue";
| ^^^^^^^^^^^^^^^^^
2 |
</code>
ERROR 5:26:26 AM
ERROR(vue-tsc) Cannot find module './DataTable.vue' or its corresponding type declarations.
FILE .../components/data-table/index.ts:1:38
> 1 | export { default as DataTable } from "./DataTable.vue";
| ^^^^^^^^^^^^^^^^^
2 |