-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Styles are not loaded in the latest Nuxt #205
Comments
It might be upstream issue: unocss/unocss#2938 |
This is resolved in the upstream now. It was related to Nuxt. Removing the lock file so the package manager would get the latest packages will fix the issues. An unrelated question, do you know if Unocss or Nuxt can generate only the necessary css for each page? |
Yes, #197 When btn will be used for the first time, UnoCSS will only load the style at that time If you don't get this behavior let me know. |
Ok so i made a barebones project to test this. You can find it here. It is basically these files. // nuxt.config.js
export default defineNuxtConfig({
vue: {
defineModel: true,
},
modules: [
'@anu-vue/nuxt',
'@unocss/nuxt',
],
});
// uno.config.js
import { defineConfig } from 'unocss';
export default defineConfig({
include: [
/.*\/anu-vue\.js(.*)?$/,
'./**/*.vue',
'./**/*.md',
],
}); // app.vue
<script setup>
</script>
<template>
<nuxt-page />
</template>
// pages/index.vue
<script setup>
</script>
<template>
<p>Hello</p>
</template> You can view it live here The important issue is that both the styles and the js bundle for all components are loaded. You can view its source, but basically, in this js bundle https://repro-anu-nuxt.vercel.app/_nuxt/entry.6f577059.js you can find all components (try searching for "ABtn" and "AList" and so on), and in this css bundle https://repro-anu-nuxt.vercel.app/_nuxt/entry.de0e007d.css you can find styles for all components. Note that this happens while nothing is used. Do you have any idea on what's wrong? |
Hi there @jd-solanki |
Sorry @yooneskh I was on holidays was busy with other things lately. I'm planning to move to Python community in near future. However, I'll try to resolve this issue and pending issue for sure 👍🏻 Maybe in next two week I'll be able to resolve this. Thanks for your interest. Would like to contribute to this? We can move this repo to org for others to contribute. |
@jd-solanki oh happy holidays! Sure i will love to contribute. I have lots of ideas to improve anu. |
Hello and thank you very much for you great work!
I just set up a minimal Nuxt project with anu but noticed the styles aren't being loaded.
This is the reproduction project https://github.com/yooneskh/repro-anu-nuxt
Is there anything wrong in it?
The text was updated successfully, but these errors were encountered: