admin管理员组

文章数量:1315044

For our Nuxt template site we have Tailwind running a custom CSS file. This is mostly editable via our CMS for different colors on different websites.

In cases of missing classnames or wrongly typed, Vite instantly picks up the missing class as an error 500 and completely ruins the page.

[plugin:vite:css] [postcss] <path_to_file>/ProductPrijsGrafiek.vue?vue&type=style&index=0&lang.css:7:5: The `dark:bg-grafiekHoverButtonn-light` class does not exist. If `dark:bg-grafiekHoverButtonn-light` is a custom class, make sure it is defined within a `@layer` directive.

I would like to catch this error and post it as an console.error.

In the vite / nitro options of my nuxt.config.ts file i was suggested to put a errorHandler array, but i got shut down pretty quickly by some vague error messages.

For information: I'm running Nuxt 3.15 in SSR mode.

Kind regards

本文标签: nuxtjsHow to fallback on custom Tailwind css classes combined with Vite in Nuxt3gtStack Overflow