Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report][3.1.3] Vite Error "Failed to resolve entry for package vuetify" when importing Sass Module #16593

Closed
nikolasdas opened this issue Feb 5, 2023 · 7 comments
Assignees
Labels
S: triage upstream Problem with a third party library that we may have to work around
Milestone

Comments

@nikolasdas
Copy link

Environment

Vuetify Version: 3.1.3
Vue Version: 3.2.47
Browsers: Google Chrome
OS: Windows

Steps to reproduce

  • Create a blank project with Vite 4, Vue 3, Sass and Vuetify 3
  • Add the Vuetify Sass Module with @use "vuetify"

Expected Behavior

The project should run normally

Actual Behavior

Error: Failed to resolve entry for package "vuetify". The package may have incorrect main/module/exports specified in its package.json.

Reproduction Link

https://stackblitz.com/edit/vitejs-vite-jdslxa?file=src/style.scss

@craigrileyuk
Copy link

craigrileyuk commented Feb 5, 2023

I'm getting this one as well, also from trying to import a config SCSS file before createVuetify:

// vuetify-config.scss
@use 'vuetify' with (
  $color-pack: false,
  $utilities: false,
  $reset: false,
);

which is imported from:

import "./vuetify-config.scss";
import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
import { createVuetify } from "vuetify";

export default createVuetify({
    icons: {
        defaultSet: "mdi",
        aliases,
        sets: {
            mdi,
        },
    },
});

and results in:

throw new Error(`Failed to resolve entry for package "${id}". ` +
          ^

Error: Failed to resolve entry for package "vuetify". The package may have incorrect main/module/exports specified in its package.json.

Have confirmed that the import of the SCSS file is the only thing that causes the error

EDIT: Seems to be a problem introduced with Vite 4.1.0+, I've bumped back to v4.0.4 and it works fine.

@KaelWD KaelWD added the upstream Problem with a third party library that we may have to work around label Feb 6, 2023
@KaelWD
Copy link
Member

KaelWD commented Feb 6, 2023

Caused by vitejs/vite#11595, vite now has no way to resolve a different sass entry without vitejs/vite#7817

@KaelWD
Copy link
Member

KaelWD commented Feb 6, 2023

I opened vitejs/vite#11947

@craigrileyuk
Copy link

Yep, further to your comment in the Vite repo @KaelWD , using:

@use 'vuetify/lib/styles/main.sass' with (
  $color-pack: false,
  $utilities: false,
  $reset: false,
);

Seems to be the way to go.

@kstraszewski
Copy link

kstraszewski commented Mar 15, 2023

I see that te issue is closed from last week, but I still can't use vuetify on Nuxt 3.2 or 3.3.1. Is there any way or we need to wait for vite 4.2?

@edit: getting same error on 3.1.10

@Maxim-Mazurok
Copy link
Contributor

To be clear, this fixed it for me: replace in my main.scss: @use "vuetify" with ( with @use "vuetify/lib/styles/main.sass" with ( as per comments above

@KaelWD
Copy link
Member

KaelWD commented Mar 16, 2023

You can use vite 4.0 or 4.2-beta, this only exists with vite 4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: triage upstream Problem with a third party library that we may have to work around
Projects
None yet
Development

No branches or pull requests

5 participants