From 6de7c72fb3965677b46c5a4cf067133038e53ef2 Mon Sep 17 00:00:00 2001 From: robonen Date: Mon, 8 Jun 2026 21:11:53 +0700 Subject: [PATCH] fix(docs): shorten TMPDIR on macOS so the dev server's vite-node socket fits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/nuxt.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts index 9223646..79a3ea3 100644 --- a/docs/nuxt.config.ts +++ b/docs/nuxt.config.ts @@ -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,