Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Nuxt Typescript Error #948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks done
kylegl opened this issue Apr 26, 2025 · 3 comments
Open
5 tasks done

Nuxt Typescript Error #948

kylegl opened this issue Apr 26, 2025 · 3 comments
Labels

Comments

@kylegl
Copy link

kylegl commented Apr 26, 2025

Describe the bug

I am using vue-macros with Nuxt 3 via the @vue-macros/nuxt module. While the macros (specifically tested defineModels) function correctly at runtime (the application runs fine in the browser after pnpm dev), TypeScript within my IDE (VS Code with Volar) is not recognizing the globally available macro functions or related types.

  "dependencies": {
    "@vue-macros/nuxt": "3.0.0-beta.10",
    "@vueuse/core": "^13.1.0",
    "@vueuse/nuxt": "^13.1.0",
    "nuxt": "^3.16.2"
  },
export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: { enabled: true },
  modules: ['@vue-macros/nuxt', '@vueuse/nuxt'],
  macros: {
    betterDefine: false,
    defineModels: true,
  },
})

Reproduction

https://stackblitz.com/~/github.com/kylegl/nuxt-tester

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
    Memory: 8.09 GB / 15.59 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 10.9.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm
    bun: 1.1.10 - ~/.bun/bin/bun
  Browsers:
    Chrome: 113.0.5672.126

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@dosubot dosubot bot added the volar label Apr 26, 2025
@kylegl
Copy link
Author

kylegl commented Apr 26, 2025

I believe i resolved this by using specifically @vue-macros/nuxt: 1.13.5 and i also had to add unplugin-vue-macros

  "devDependencies": {
    "@vue-macros/nuxt": "1.13.5",
    "unplugin-vue-macros": "^2.14.5"
  }

is this intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@kylegl and others