From d210c03ac7aff6e21cef531bf5456efde9041110 Mon Sep 17 00:00:00 2001 From: "Anthony Fu (via agent)" Date: Fri, 11 Sep 2026 02:32:43 +0000 Subject: [PATCH] fix(ci): resolve #shared alias in vitest and raise macOS build heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vitest had no alias for Nuxt's #shared virtual import, so src/app/utils/semver.test.ts (and any test that transitively imports a module using #shared/*) failed with ERR_MODULE_NOT_FOUND on ubuntu/windows. The macOS test job's Build step OOM'd while unbuild/rollup bundled node-modules-tools; raise NODE_OPTIONS max-old-space-size for that job. 🤖 Generated with the help of an agent --- .github/workflows/ci.yml | 5 +++++ packages/node-modules-inspector/vitest.config.ts | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 packages/node-modules-inspector/vitest.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5eea682b..711fb7f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,11 @@ jobs: test: runs-on: ${{ matrix.os }} + env: + # macos-latest runners report a lower usable heap than their physical + # RAM, which OOMs unbuild/rollup while bundling node-modules-tools. + NODE_OPTIONS: --max-old-space-size=6144 + strategy: matrix: node: [lts/*] diff --git a/packages/node-modules-inspector/vitest.config.ts b/packages/node-modules-inspector/vitest.config.ts new file mode 100644 index 00000000..2222b5c8 --- /dev/null +++ b/packages/node-modules-inspector/vitest.config.ts @@ -0,0 +1,13 @@ +import { fileURLToPath } from 'node:url' +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + resolve: { + alias: { + // Mirrors Nuxt's built-in `#shared` alias (nuxt.config.ts `srcDir: 'app'`, + // shared dir defaults to `/shared` i.e. `src/shared`), which + // vitest doesn't pick up on its own. + '#shared': fileURLToPath(new URL('./src/shared', import.meta.url)), + }, + }, +})