question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[unocss:global:build:generate] [unocss] does not found CSS placeholder in the generated chunks

See original GitHub issue

https://github.com/ckvv/vite-project

The following error is thrown when the output file is multiple in library mode https://github.com/ckvv/vite-project/blob/3b4f3c84c2b9cd4f0e0ee883da6439077cad1811/vite.config.js#L12

[unocss:global:build:generate] [unocss] does not found CSS placeholder in the generated chunks,
this is likely an internal bug of unocss vite plugin
error during build:
Error: [unocss] does not found CSS placeholder in the generated chunks,
this is likely an internal bug of unocss vite plugin
    at Object.generateBundle (/Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/@unocss+vite@0.44.7_vite@2.9.14/node_modules/@unocss/vite/dist/index.cjs:364:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Bundle.generate (/Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/rollup@2.77.1/node_modules/rollup/dist/shared/rollup.js:16103:9)
    at async /Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/rollup@2.77.1/node_modules/rollup/dist/shared/rollup.js:23746:27
    at async catchUnfinishedHookActions (/Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/rollup@2.77.1/node_modules/rollup/dist/shared/rollup.js:23161:20)
    at async doBuild (/Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/vite@2.9.14/node_modules/vite/dist/node/chunks/dep-c9998dc6.js:41721:26)
    at async build (/Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/vite@2.9.14/node_modules/vite/dist/node/chunks/dep-c9998dc6.js:41552:16)
    at async CAC.<anonymous> (/Users/chenkai/Downloads/mini-vue/node_modules/.pnpm/vite@2.9.14/node_modules/vite/dist/node/cli.js:738:9)

The problem occurs in version v0.43.2

related to this commithttps://github.com/unocss/unocss/pull/1217

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Jelenkeecommented, Aug 3, 2022

I’m having the same problem with Astro. In dev mode everything works fine but when I build the project, it fails. Setting build.cssCodeSplit to false did not help. I’m using unocss 0.45.1

astro.config.mjs

import { defineConfig } from 'astro/config';
import { presetUno } from "unocss";
import unocss from "unocss/vite";
import icons from "@unocss/preset-icons";
import svelte from "@astrojs/svelte";
import { extractorSvelte } from "@unocss/core";


export default defineConfig({
    integrations: [svelte()],
    vite: {
        plugins: [
            unocss({
                presets: [
                    presetUno(),
                    icons()
                ],
                extractors: [extractorSvelte],
            }),
        ],
        ssr: {
            noExternal: ["modern-normalize"]
        }
    }
});

layout.astro

---
import "modern-normalize";
import "uno.css";
import "../main.scss"
import Header from "../layouts/header.astro";
---
<some-markup>
0reactions
vipero07commented, Aug 9, 2022

Setting build.cssCodeSplit to false did not help.

we said set it to true

This actually fixed the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[unocss] does not found CSS placeholder in the generated ...
I get this error message when I try to build my Astro project where I use unocss. Version: 0.45.6 There was a fix...
Read more >
@unocss/vite - npm
Start using @unocss/vite in your project by running `npm i ... This mode will generate a CSS sheet for each code chunk on...
Read more >
[unocss:global:build:generate] [unocss] does not found CSS ...
[unocss:global:build:generate] [unocss] does not found CSS placeholder in the generated chunks.
Read more >
placeholder - CSS: Cascading Style Sheets - MDN Web Docs
The ::placeholder CSS pseudo-element represents the placeholder text in an or element.
Read more >
Placeholder CSS not being applied in IE 11 - Stack Overflow
In general, when styling placeholders. When encountering an unsupported vendor prefix, CSS parsing engines will consider the entire rule ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found