nuxt / nuxt/ui

useAppConfig works but is typed as any in Vue

Open
#6,068 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

vue
Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

Environment

| Operating system | Linux 6.17.0-14-generic |
| CPU | 12th Gen Intel(R) Core(TM) i7-1255U (12 cores) |
| Node.js version | v20.19.5 |
| Package manager | pnpm@10.20.0 |
| Builder | vite@5.4.19 |

Is this bug related to Nuxt or Vue?

Vue

Package

v4.x

Version

v4.4.0

Reproduction

Just write const appConfig = useAppConfig() in any Vue component and see that appConfig is any

Description

Refactoring my project, I wanted the resolved config in order to access icons.
I wanted to import useAppConfig but it's only defined in auto-imports (not a real problem).
When trying to use it, I actually get the right value BUT config is typed as any.

Additional context

Digging a bit in node_modules, I found this in runtime/vue/composables/useAppConfig.d.ts :
export declare const useAppConfig: () => any;

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated declaration at runtime/vue/composables/useAppConfig.d.ts and trace where its type is produced. Reproduce the issue with const appConfig = useAppConfig() in a Vue component using the reported v4.4.0 setup. Done means the composable exposes a specific config type instead of any while retaining the current runtime value.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.