vuetifyjs / vuetifyjs/nuxt-module
Aliases don't seem to work when defined in blueprints
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 286
- Forks
- 35
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 4
Description
https://stackblitz.com/edit/nuxt-starter-5qj9ao?file=nuxt.config.ts
Defaults work, but components inside aliases have a Component is missing template or render function warning and don't render.
From a quick look at source code, I think it's because they don't get mapped to the components properly like the regular aliases config property.
Current hack solution
// vuetify.config.ts
...
blueprint: {
defaults: blueprint.defaults,
},
aliases: blueprint.aliases,
...
// blueprint.ts
import type { ComponentName } from 'vuetify-nuxt-module'
export default {
aliases: {
MyBtn: 'VBtn',
} as Record<string, ComponentName>,
...
}
Bonus tip for anyone dealing with Typescript and needing Intellisense on your virtual components:
declare module '@vue/runtime-dom' {
export interface GlobalComponents {
MyBtn: typeof import('vuetify/components')['VBtn']
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the StackBlitz reproduction and inspect nuxt.config.ts, vuetify.config.ts, and blueprint.ts, comparing blueprint aliases with the regular aliases configuration. Trace how aliases are mapped to components and verify the result by rendering MyBtn without the workaround; done means blueprint-defined aliases render without the missing-template warning.
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
- 48/100