nuxt-authorization icon indicating copy to clipboard operation
nuxt-authorization copied to clipboard

`defineAbility` auto-import isn't working

Open vaaski opened this issue 4 months ago • 2 comments

Additionally to #70, the auto-import for defineAbility seems broken and shows type errors if not imported manually.

Image Image

Repro is the same as #70: https://stackblitz.com/edit/github-kun89cza?file=app%2Fapp.vue

vaaski avatar Aug 18 '25 17:08 vaaski

I have the same issue after updating the root tsconfig.json file of my Nuxt app to the new structure:

{
  // https://nuxt.com/docs/guide/concepts/typescript
  "files": [],
  "references": [
    {
      "path": "./.nuxt/tsconfig.app.json"
    },
    {
      "path": "./.nuxt/tsconfig.server.json"
    },
    {
      "path": "./.nuxt/tsconfig.shared.json"
    },
    {
      "path": "./.nuxt/tsconfig.node.json"
    }
  ]
}

Coming back to the old:

{
  // https://nuxt.com/docs/guide/concepts/typescript
  "extends": "./.nuxt/tsconfig.json"
}

fixes the issue. Any clue @Barbapapazes ?

rcoudercher avatar Oct 23 '25 14:10 rcoudercher

"extends": "./.nuxt/tsconfig.json"

It works, but it will be removed in future versions of Nuxt and is less optimal in terms of performance.

Gobler avatar Nov 08 '25 08:11 Gobler