NuxtN
Nuxt2y ago
Exuma

Cannot find module './DataTable.vue' or its corresponding type declarations

My folder structure:

...
├── components
│   ├── MainNav.vue
│   ├── PageHeader.vue
│   ├── data-table
│   │   ├── DataTable.vue
│   │   └── index.ts


Inside
index.ts
:

export { default as DataTable } from "./DataTable.vue";


What am I doing that's dumb? I am getting this error, and 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
nuxt.config.ts
to no avail...

  typescript: {
    strict: true,
    typeCheck: true,
    tsConfig: {
      compilerOptions: {
        paths: {
          "~/*": ["./*"],
          "@/*": ["./*"],
        },
      },
    },
  },
Was this page helpful?