Skip to content

Usage instructions for Vue 2.7 are inaccurate #294

@FichteFoll

Description

@FichteFoll

Version

  • Vue version: 2.7

Description

Trying to import import VueFormMultiselect from '@vueform/multiselect/multiselect.vue2.js' fails in both vite and webpack with an error message like follows:

[vite] Internal server error: Failed to resolve import "@vueform/multiselect/multiselect.vue2.js" from "src/components/TheWelcome.vue". Does the file exist?

It works if the dist folder is added inbetween, i.e.

import VueFormMultiselect from '@vueform/multiselect/dist/multiselect.vue2.js';

However, typescript then complains about not having any type declarations for this file, so you additionally need the following multiselect.d.ts:

declare module '@vueform/multiselect/dist/multiselect.vue2.js' {
    import Multiselect from '@vueform/multiselect';
    export default Multiselect;
}

Demo

I don't know how to set up a jsfiddle with this specific setup. My apologies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions