Skip to content

[Vue warn]: Failed to resolve component: t-alert #53

Description

@robtesch

Hi there, thank you so much for this lib. I've just started upgrading my vue2 app to vue3. I am probably missing something really basic here, but for some reason, no matter what I try and do, I cannot use this amazing lib in the same way as I did with Vue2.

I have tried to install this in the "new way" like so:

import { variantJS } from '@variantjs/vue'
import Settings from "./vue-tailwind/settings/index";

const app = createApp({});
app.use(variantJS, Settings);

app.mount('#app');

Now, with the old version, that meant that all components were now globally available, and I could just do something like:

<template>
    <t-alert
      :show="showAlert"
      variant="success"
    >
      Awesome!
    </t-alert>
</template>

And I didn't have to do anything like this to register the component "locally":

import {TAlert} from "@variantjs/vue";

export default {
  name: "MyComponent",
  components: {
    TAlert,
  },
}

However, if I try this now, I just get a bunch of vue errors in the console saying that vue cannot resolve the component (as per title). Am I missing something here? I'm happy to provide any extra info you might need.

For what it's worth, this is a laravel project, using laravel mix as a wrapper for webpack. I am able to register my own components globally just fine, with app.component().

I have also tried to just do app.use(variantJS) without the settings, in case my settings were not compatible with the new version, but even this fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions