fix(ci): resolve #shared alias in vitest and raise macOS build heap - #205
Merged
Merged
Conversation
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
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI has been red on
mainsincechore: fix build(2d437bd):test:src/app/utils/semver.test.tsfails withERR_MODULE_NOT_FOUND: Cannot find module '#shared/semver'. That commit switched several imports from relative paths to Nuxt's#sharedvirtual alias, which Nuxt only wires up at build/dev time — plain vitest has no idea what#sharedmeans.test: theBuildstep OOMs whileunbuild/rollup bundlesnode-modules-tools(JavaScript heap out of memory), before the test runner even starts.Fix
packages/node-modules-inspector/vitest.config.tswith aresolve.aliasfor#shared→./src/shared, mirroring Nuxt's own convention (rootDir issrc, so its default shared dir issrc/shared).NODE_OPTIONS=--max-old-space-size=6144for thetestjob in.github/workflows/ci.ymlso 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 typecheckall pass.This PR was created with the help of an agent.