Skip to content

CSS import not working in Nuxt 3 #82

@shamsadanam

Description

@shamsadanam

Issue: Unable to Import CSS File from v-dropdown-menu Package

Nuxt Version: ^3.6.5
v-dropdown-menu Version: ^2.0.4


Problem

I'm trying to import the CSS file for the v-dropdown-menu package in a component like this:

import "v-dropdown-menu/dist/vue3/v-dropdown-menu.css";

However, this results in the following error:

[plugin:vite:import-analysis] Missing "./dist/vue3/v-dropdown-menu.css" specifier in "v-dropdown-menu" package

Workaround

Currently, I’m working around this issue by importing the file directly from node_modules, like so:

import "../node_modules/v-dropdown-menu/dist/vue3/v-dropdown-menu.css";

But this approach is not ideal or recommended.


Expected Behavior

The CSS should be importable using the standard package path:

import "v-dropdown-menu/dist/vue3/v-dropdown-menu.css";

Notes

It seems the package might be missing the proper export for the CSS file in its package.json.
Please advise if I'm doing something wrong or if this needs to be fixed in the package itself.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions