nuxt-modules / og-image

Generate OG Images with Vue templates in Nuxt.
https://nuxtseo.com/og-image
415 stars 27 forks source link

fix: Cannot find module '#imports' or its corresponding type declarations. #268

Closed lukaszarpak closed 1 month ago

lukaszarpak commented 1 month ago

🐛 The bug

Nuxt3 app doesn't build when og-image module is added.

I cannot provide a reproduction repo due to the bug occurring only in one of my private repos which I am not allowed to share.

🛠ī¸ To reproduce

https://stackblitz.com/edit/nuxt-starter-pxs3wk?file=pages%2Findex.vue

🌈 Expected behavior

The build command should not throw any errors.

ℹī¸ Additional context

.nuxt.config.ts

 modules: [
    "@nuxtjs/tailwindcss",
    "@nuxtjs/i18n",
    "@pinia/nuxt",
    "nuxt-xstate",
    "nuxt-jsonld",
    "nuxt-viewport",
    "floating-vue/nuxt",
    "@nuxt/image",
    "nuxt-vue3-google-signin",
    "nuxt-og-image",
  ],
vite: {
    css: {
      preprocessorOptions: {
        scss: {
          api: "modern-compiler",
        },
      },
    },
    plugins: [
      svgLoader({
        svgo: false,
      }),
    ],
  },
  typescript: {
    typeCheck: true,
  },

tsconfig.json

{
  "extends": "./.nuxt/tsconfig.json",
  "compilerOptions": {
    "types": [
      "@nuxtjs/i18n",
    ],
    "paths": {
      "@/*": [
        "./*"
      ]
    },
    "noImplicitAny": false,
  },
}
lukaszarpak commented 1 month ago

Ok it seems to be resolved now when I removed types and paths from my local tsconfig.json:

"types": [
      "@nuxtjs/i18n",
    ],
    "paths": {
      "@/*": [
        "./*"
      ]
    },