fix(docs): shorten TMPDIR on macOS so the dev server's vite-node socket fits

Nuxt's dev vite-node IPC uses a unix socket under $TMPDIR. macOS's default /var/folders/… tmp dir pushes the path to ~110 chars, past the ~104-char sun_path limit, so every request 500s with 'connect EINVAL'. Point $TMPDIR at /tmp on darwin (guarded; other platforms untouched) before the builder generates the socket path.
This commit is contained in:
2026-06-08 21:11:53 +07:00
parent 53c725d3b2
commit 6de7c72fb3
+8
View File
@@ -1,5 +1,13 @@
import { tmpdir } from 'node:os';
import tailwindcss from '@tailwindcss/vite';
// macOS dev fix: Nuxt's vite-node IPC uses a unix socket under $TMPDIR, and the
// default macOS temp dir (/var/folders/…) pushes the socket path past the
// ~104-char sun_path limit → `connect EINVAL` on every request. Point $TMPDIR
// at a short directory so `nuxt dev` works. Other platforms are unaffected.
if (process.platform === 'darwin' && tmpdir().length > 30)
process.env.TMPDIR = '/tmp';
export default defineNuxtConfig({
future: {
compatibilityVersion: 4,