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.0.0-alpha.11] * vuetify/styles not found after following Setup Guide (Vue3) #303

Closed
SilasNiewierra opened this issue Sep 21, 2021 · 22 comments

Comments

@SilasNiewierra
Copy link

Environment

Vuetify Version: 3.0.0-alpha.11
Vue Version: 3.2.12
Browsers: Chrome 93.0.4577.63
OS: Mac OS 10.15.7

Steps to reproduce

Follow this docu: https://next.vuetifyjs.com/en/getting-started/installation/

  1. Install latest Vue Cli: @vue/cli 4.5.13
  2. Choose: Default (Vue 3 Preview) ([Vue 3] babel, eslint)
  3. cd my-app
  4. vue add vuetify
  5. Choose: V3 (alpha)
  6. Replace main.js with
import 'vuetify/styles'
import { createApp } from 'vue'
import { createVuetify } from 'vuetify'
import App from './App.vue'
const app = createApp(App)
const vuetify = createVuetify()
app.use(vuetify)
app.mount('#app')

Expected Behavior

Working App with Vuetify Styles

Actual Behavior

After "npm run serve" the following error message appears:

This dependency was not found:
* vuetify/styles in ./src/main.js
To install it, you can run: npm install --save vuetify/styles

Reproduction Link

https://codepen.io/cameron_creative/pen/GREdeqX

Other comments

I followed the default instructions and am still not able to get Vuetify 3 running.

@DeivisFelipe
Copy link

I took the test and it worked for me

@Naurotski
Copy link

does not work

ERROR Failed to compile with 2 errors 9:14:52 PM

These dependencies were not found:

  • @mdi/font/css/materialdesignicons.css in ./src/plugins/vuetify.js
  • vuetify/styles in ./src/plugins/vuetify.js

@LucianHij
Copy link

I have the same problem

@KaelWD KaelWD transferred this issue from vuetifyjs/vuetify Oct 14, 2021
@LucianHij
Copy link

@KaelWD why this has the label need reproduction? Is it working for you when you follow the exact steps from the Installation documentation?

@KaelWD
Copy link
Member

KaelWD commented Oct 14, 2021

Yes

@LucianHij
Copy link

LucianHij commented Oct 14, 2021

@KaelWD have you checked the reproduction link? https://codepen.io/cameron_creative/pen/GREdeqX
Maybe you can tell us what version of node and vue-cli you are using, because i tried with "everything" and could not make it work.

@KaelWD
Copy link
Member

KaelWD commented Oct 14, 2021

Screenshot_20211014_203417

@LucianHij
Copy link

LucianHij commented Oct 14, 2021

These are the first errors after installing step by step from documentation with same versions of node and vue/cli. These errors i could fix by deleting vuetify-loader from package.json.
image

After that i get this errors, and I fixed them by changing the version in package json to "@vue/cli-service": "~4.5.0".
image

And after that, i get this error on npm run serve and this i cannot fix anymore. The second error i get on npm install.
image

@LucianHij
Copy link

LucianHij commented Oct 14, 2021

Oh, the vue version on myside is 4.5.14. I will check if this is the problem.

EDIT: Same problem with 4.5.13

@KaelWD
Copy link
Member

KaelWD commented Oct 14, 2021

This is the same problem we saw in discord then, npm doesn't resolve conflicting versions of webpack well. You need to run #302. If you use typescript there is also vuejs/vue-cli#6350

@KaelWD KaelWD closed this as completed Oct 14, 2021
@reemaalwail
Copy link

does not work

ERROR Failed to compile with 2 errors 9:14:52 PM

These dependencies were not found:

  • @mdi/font/css/materialdesignicons.css in ./src/plugins/vuetify.js
  • vuetify/styles in ./src/plugins/vuetify.js

Environment

Vuetify Version: 3.0.0-alpha.11 Vue Version: 3.2.12 Browsers: Chrome 93.0.4577.63 OS: Mac OS 10.15.7

Steps to reproduce

Follow this docu: https://next.vuetifyjs.com/en/getting-started/installation/

  1. Install latest Vue Cli: @vue/cli 4.5.13
  2. Choose: Default (Vue 3 Preview) ([Vue 3] babel, eslint)
  3. cd my-app
  4. vue add vuetify
  5. Choose: V3 (alpha)
  6. Replace main.js with
import 'vuetify/styles'
import { createApp } from 'vue'
import { createVuetify } from 'vuetify'
import App from './App.vue'
const app = createApp(App)
const vuetify = createVuetify()
app.use(vuetify)
app.mount('#app')

Expected Behavior

Working App with Vuetify Styles

Actual Behavior

After "npm run serve" the following error message appears:

This dependency was not found:
* vuetify/styles in ./src/main.js
To install it, you can run: npm install --save vuetify/styles

Reproduction Link

https://codepen.io/cameron_creative/pen/GREdeqX

Other comments

I followed the default instructions and am still not able to get Vuetify 3 running.
same problem ... what the solution now ??

@ikhidebright
Copy link

This is still an issue, had anyone solved this?

@ikhidebright
Copy link

Okay, was able to get it to work by:

Updating my @vue/cli version (5.0.4)
Deleted .vuerc file in C://Users/Administrator

then followed steps in creating vue app with vuetify

@guilmarc
Copy link

Having the same problem here. Any workaroud ?

@harundogan01
Copy link

@ikhidebright This solution is not working for me

@lukasz-madon
Copy link

try import 'vuetify/dist/vuetify.css'

@Logeswaras
Copy link

Logeswaras commented Jun 2, 2022

I got also same issue

ERROR Failed to compile with 1 error 2:04:05 pm

This dependency was not found:

  • vuetify/styles in ./src/plugins/vuetify.ts

To install it, you can run: npm install --save vuetify/styles
Issues checking in progress...
No issues found.

`import "@mdi/font/css/materialdesignicons.css";
import "vuetify/styles";

// Vuetify
import { createVuetify } from "vuetify";

export default createVuetify();`

@hamadasyoutarou
Copy link

hamadasyoutarou commented Jun 8, 2022

I tried import "vuetify/lib/styles/main.css"; and worked it.
But this is not cool.
What should I do for the best?

@shakaran
Copy link

I run:

vue upgrade

it upgrade this:

  Name                    Installed       Wanted          Latest          Command to upgrade
  @vue/cli-service        4.5.19          4.5.19          5.0.8           vue upgrade @vue/cli-service
  @vue/cli-plugin-babel   4.5.19          4.5.19          5.0.8           vue upgrade @vue/cli-plugin-babel
  @vue/cli-plugin-eslint  4.5.19          4.5.19          5.0.8           vue upgrade @vue/cli-plugin-eslint

Then it works for me

@swasher
Copy link

swasher commented Sep 12, 2022

Have a same problem.

main.js

import { createApp } from 'vue'
import App from './App.vue'
import { firebaseApp } from './firebase'
import router from './router'
import { createPinia } from 'pinia'
import { createVuetify } from 'vuetify'
import { loadFonts } from './plugins/webfontloader'
import "vuetify/lib/styles/main.css";
loadFonts()

const Pinia = createPinia()
const app = createApp(App)
const vuetify = createVuetify()

app.use(router)
app.use(vuetify)
app.use(Pinia)
app.use(firebaseApp)

app.mount('#app')

plugins/vuetify.js

import { createApp } from 'vue'
import App from './App.vue'
import { firebaseApp } from './firebase'
import router from './router'
import { createPinia } from 'pinia'
import { createVuetify } from 'vuetify'
import { loadFonts } from './plugins/webfontloader'
import "vuetify/lib/styles/main.css";
loadFonts()

const Pinia = createPinia()
const app = createApp(App)
const vuetify = createVuetify()

app.use(router)
app.use(vuetify)
app.use(Pinia)
app.use(firebaseApp)

app.mount('#app')

vite.config.js

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vuetify from 'vite-plugin-vuetify'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        vue(),
        vuetify({ autoImport: true }),
    ],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    }
})

With import "vuetify/lib/styles/main.css"; styles work.

@kamilzazi
Copy link

For me works:

main.js:

import { createApp } from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import { loadFonts } from './plugins/webfontloader'


loadFonts()

createApp(App)
  .use(vuetify)
  .mount('#app')

plugins/vuetify.js

// Styles
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'

import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'

export default createVuetify({
    components,
    directives,
})

Chejin-cheol pushed a commit to Chejin-cheol/ArtisyServiceVue that referenced this issue Sep 25, 2023
@andrew99154
Copy link

andrew99154 commented Jul 3, 2024

Refer to the official docs, about "Existing projects" part:
https://vuetifyjs.com/zh-Hans/getting-started/installation/#section-73b06709987976ee

Run the command first:
npm i vuetify

Then update main.js into following:

import { createApp } from 'vue'

// Vuetify
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'

// Components
import App from './App.vue'

const vuetify = createVuetify({
  components,
  directives,
})

createApp(App).use(vuetify).mount('#app')

Just a little reminder, if you are using docker to run the project, try to delete the whole image and recreate again. Docker sometimes could not detect the change of npm packages dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests