vue-query-nuxt icon indicating copy to clipboard operation
vue-query-nuxt copied to clipboard

`vue-query.config.ts` is not including in the `.nuxt/tsconfig.app.json` that introduced in nuxt 4

Open n0099 opened this issue 3 months ago • 0 comments
trafficstars

Environment

  "@hebilicious/vue-query-nuxt": "^0.3.0",
  "nuxt": "^4.0.3",

Reproduction

https://codesandbox.io/p/devbox/stupefied-thompson-lvcs8w

Describe the bug

After migrate tsconfig.json to the new project references: https://nuxt.com/docs/4.x/getting-started/upgrade#typescript-configuration-splitting , auto imports in vue-query.config.ts

export default defineVueQueryPluginHook(() => ({}));

will have:

vue-query.config.ts:1:16 - error TS2304: Cannot find name 'defineVueQueryPluginHook'.

1 export default defineVueQueryPluginHook(() => ({}));
                 ~~~~~~~~~~~~~~~~~~~~~~~~

And import it:

import { defineVueQueryPluginHook } from "@hebilicious/vue-query-nuxt/dist/runtime/composables/defineVueQueryPluginHook.js";

will cause

Cannot find package '@hebilicious/vue-query-nuxt/dist/runtime/composables/defineVueQueryPluginHook.js' imported from 'virtual:nuxt:<...>.nuxt%2Finternal.vue-query-plugin-hook.mjs'

in any page.

An workaround is including it manually in nuxt.config.ts:

export default defineNuxtConfig({
    typescript: {
        tsConfig: { include: ['../vue-query.config.ts'] }
    }
});

Additional context

No response

Logs

No response

n0099 avatar Aug 16 '25 09:08 n0099