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

Build fails relating to UnoCSS, works on dev #243

Closed
davesierra opened this issue May 5, 2022 · 3 comments
Closed

Build fails relating to UnoCSS, works on dev #243

davesierra opened this issue May 5, 2022 · 3 comments

Comments

@davesierra
Copy link

Hello, was encouraged to report via the message [vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues

So after cloning vitesse and running it via pnpm dev, everything works fine.

I also used this as a starter template, so afterwards I've made a couple modifications; happy to provide details if needed.

However when I try to do pnpm build, I get an error.

Here is a paste of the exact error reported:

174 modules transformed.
rendering chunks (4)...[unocss:global:build:generate] [unocss] does not found CSS placeholder in the generated chunks,
this is likely an internal bug of unocss vite plugin

PWA v0.12.0
mode      generateSW
precache  5 entries (0.00 KiB)
files generated
  dist/sw.js
  dist/workbox-f51ab5e4.js
warnings
  One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": "/Users/davesierra/Projects/companyname/projectname/dist",
  "globPattern": "**/*.{js,css,html}",
  "globIgnores": [
    "**/node_modules/**/*",
    "sw.js",
    "workbox-*.js"
  ]
}


[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
/Users/davesierra/Projects/companyname/projectname/node_modules/@unocss/vite/dist/index.cjs:306
          this.error(new Error("[unocss] does not found CSS placeholder in the generated chunks,\nthis is likely an internal bug of unocss vite plugin"));
                     ^

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/davesierra/Projects/companyname/projectname/node_modules/@unocss/vite/dist/index.cjs:306:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Bundle.generate (/Users/davesierra/Projects/companyname/projectname/node_modules/.pnpm/rollup@2.70.2/node_modules/rollup/dist/shared/rollup.js:16058:9)
    at async /Users/davesierra/Projects/companyname/projectname/node_modules/.pnpm/rollup@2.70.2/node_modules/rollup/dist/shared/rollup.js:23679:27
    at async catchUnfinishedHookActions (/Users/davesierra/Projects/companyname/projectname/node_modules/.pnpm/rollup@2.70.2/node_modules/rollup/dist/shared/rollup.js:23121:20)
    at async doBuild (/Users/davesierra/Projects/companyname/projectname/node_modules/.pnpm/vite@2.9.5/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:39185:20)
    at async Object.build (/Users/davesierra/Projects/companyname/projectname/node_modules/.pnpm/vite@2.9.5/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:39011:16)
    at async Object.build (/Users/davesierra/Projects/companyname/projectname/node_modules/vite-ssg/dist/chunks/build.cjs:135:3)
    at async Object.handler (/Users/davesierra/Projects/companyname/projectname/node_modules/vite-ssg/dist/node/cli.cjs:25:3) {
  code: 'PLUGIN_ERROR',
  plugin: 'unocss:global:build:generate',
  hook: 'generateBundle'
}

Node.js v17.6.0
 ELIFECYCLE  Command failed with exit code 1.
@userquin
Copy link
Member

userquin commented May 7, 2022

@davesierra provide a minimal repro on github or stackblitz

@alvarosabu
Copy link

alvarosabu commented Aug 1, 2022

I think this is an issue on the @unocss/vite package rather than this check here unocss/unocss#1341

@antfu
Copy link
Member

antfu commented Aug 1, 2022

We temporarily close this due to the lack of enough information.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

@antfu antfu closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants