antfu-collective / vite-ssg

Static site generation for Vue 3 on Vite
MIT License
1.32k stars 136 forks source link

Adding ClientOnly to any part of the App.Vue gives an empty error #396

Open rezelute opened 5 months ago

rezelute commented 5 months ago

Describe the bug

What im trying to do: I only want to pre-render for the purpose of social media previews (unfurling) but Im unable to wrap everything in the App template with ClientOnly. But then I also tried to wrap anything in ClientOnly in App.Vue and I also get an error when trying to build:

<template>
   <div>
      <RouterView />

      <ClientOnly>
         <p>test</p>
      </ClientOnly>
   </div>
</template>

The error:

[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: ENOTEMPTY: directory not empty, rmdir 'C:\...\.vite-ssg-temp\ze9v78zw2v\assets'] {
  errno: -4051,
  code: 'ENOTEMPTY',
  syscall: 'rmdir',
  path: 'C:\\...\\.vite-ssg-temp\\ze9v78zw2v\\assets'
}
node:child_process:935
    throw err;

Reproduction

in describe bug

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 11.51 GB / 31.92 GB
  Binaries:
    Node: 16.20.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (123.0.2420.97)

Used Package Manager

npm

Validations

yayxs commented 2 months ago

Change the version of node and try it