Skip to content

fix(ci): resolve #shared alias in vitest and raise macOS build heap - #205

Merged
antfu merged 1 commit into
antfu:mainfrom
antfubot:fix/ci-shared-alias-and-macos-oom
Sep 11, 2026
Merged

antfu merged 1 commit into
antfu:mainfrom
antfubot:fix/ci-shared-alias-and-macos-oom

Conversation

@antfubot

Copy link
Copy Markdown
Contributor

Problem

CI has been red on main since chore: fix build (2d437bd):

  • ubuntu-latest / windows-latest test: src/app/utils/semver.test.ts fails with ERR_MODULE_NOT_FOUND: Cannot find module '#shared/semver'. That commit switched several imports from relative paths to Nuxt's #shared virtual alias, which Nuxt only wires up at build/dev time — plain vitest has no idea what #shared means.
  • macos-latest test: the Build step OOMs while unbuild/rollup bundles node-modules-tools (JavaScript heap out of memory), before the test runner even starts.

Fix

  • Add packages/node-modules-inspector/vitest.config.ts with a resolve.alias for #shared./src/shared, mirroring Nuxt's own convention (rootDir is src, so its default shared dir is src/shared).
  • Bump NODE_OPTIONS=--max-old-space-size=6144 for the test job in .github/workflows/ci.yml so the macOS runner has enough heap to complete the build.

Verified locally: pnpm vitest run (19/19 files, 128/128 tests), pnpm build, pnpm lint, pnpm typecheck all pass.


This PR was created with the help of an agent.

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
@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/node-modules-inspector@205
npm i https://pkg.pr.new/node-modules-tools@205

commit: d210c03

@antfu
antfu merged commit af9f92c into antfu:main Sep 11, 2026
10 of 11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants