Skip to content

ci(workflows): run the packed plugin on windows with the wasm engine - #149

Merged
ChristopherPHolder merged 2 commits into
mainfrom
ci/windows-wasm
Dec 4, 2026
Merged

ChristopherPHolder merged 2 commits into
mainfrom
ci/windows-wasm

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

Closes #134. Follow-up: #148, a native win32 ngp engine.

What this shows

The plugin doesn't run on Windows, not even with engine: 'wasm'. The new CI job shows how far it gets:

  • Passes: the packed create-ngp scaffolds app and app-ssr, and pnpm install installs the packed plugin.
  • Fails: vite build stops before compiling anything:
[plugin vite-plugin-ngp] D:/a/_temp/app/src/main.ts
Error: Could not load the ng-exp-compiler analysis engine.
Host: win32/x64, node v26.12.0
  1. wasm   D:\a\_temp\app\node_modules\...\vite-plugin-ngp\ngp\engines\wasm\ng_analyze.js
       via wasmBinding option
       Failed to resolve tsconfig: TsconfigNotFound("D:\\a\\_temp\\app\\tsconfig.app.json")

Why: the wasm engine is built for wasm32-unknown-unknown, so its Rust code reads paths by Unix rules. To it, D:\… and D:/… are relative paths. The plugin's entry tsconfig extends the app's by absolute path, and the engine joins that onto its own folder and finds nothing.

Probe. A one-off probe on the runner (CI run 47263642184, not kept in the repo) loaded the engine from the installed plugin with a logging host filesystem and asked for app.ts's metadata, with the tsconfig path written three ways:

Form Result
D:\a\_temp\app\tsconfig.app.json Resolves only because the working directory is the app; writes specifiers like ./D:/a/_temp/app/src/app/app. 56 fs calls
D:/a/_temp/app/tsconfig.app.json include becomes D:/a/_temp/app/D:/a/_temp/app/src/**, then the engine walks the whole folder, node_modules included. 12,401 fs calls
/D:/a/_temp/app/tsconfig.app.json, with a host fs that drops the slash Correct metadata, specifier ./app. 94 fs calls

Why there's no fix here. Fixing this in the plugin means wrapping every path into and out of ngp's analyzer, whose API isn't public. That's bigger than the small fixes this issue allowed, so I stopped. #148 has the two ways out: that path adapter, or a native win32-x64 engine, with what each would take (Rust target, the bash/uname assumptions in toolchain/, the PE header in bundle.mjs, a runner).

What changed

  • ci.yml, build job: after bundle.mjs --host-only, it packs the plugin (--config.ignore-scripts, as create-ngp's tests do) and create-ngp, checks that package/ngp/engines/wasm/ng_analyze_bg.wasm is in the tarball, and uploads both as the packed artifact.
  • ci.yml, new windows job on windows-latest, needs: build, continue-on-error: true:
    • It sparse-checks out only .nvmrc, package.json and .github/scripts, and doesn't build ngp.
    • It scaffolds both templates with the packed scaffolder, sets engine: 'wasm' in vite.config.ts and vitest.config.ts, and runs pnpm install, vite build, vitest run, a dev-server fetch, and for app-ssr the prerender check and dist/server/server.js.
    • Helpers are in .github/scripts/windows-app.mjs. Servers start with node, not .cmd shims, so stopping the child stops them.
    • Why ci.yml and not a new workflow: the packed plugin is an artifact of build, and a separate workflow would have to build ngp again or hook onto ci with workflow_run.
    • A comment above the job says what it fails on today and to drop continue-on-error once it passes.
  • fix(vite-plugin-ngp): on win32-*, the missing-native-engine error no longer says "Set engine: 'wasm', which runs anywhere". It says the plugin doesn't run on Windows yet, to use WSL 2, and links Add a native win32 ngp engine to the publish matrix #148. Other platforms keep the wasm advice, without "runs anywhere". New test in toolchain.test.mjs.
  • Docs:
    • Status: the Windows row ("Doesn't work", what the job shows, use WSL 2, Add a native win32 ngp engine to the publish matrix #148), the unofficial-build bullet and the measurement bullet.
    • Configuration: the engine: 'wasm' paragraph no longer lists Windows or says "works everywhere", and the error-table row is updated.
    • Getting started: the OS row.
    • Vite+: Limits now has a one-line pointer to Status.
    • The Comparison and Creating an app pages, and the README, no longer say "untested".
    • Changelog line under 4 December 2026.
    • Decision 86 and a line in design.md.

How it was verified

  • The same steps on macOS with the wasm engine. Before the first push I packed both packages, scaffolded app with the packed create-ngp, and ran windows-app.mjs prepare, pnpm install, pnpm run build, pnpm test and windows-app.mjs serve. Results: type-check: no errors (493 ms), ✓ built in 1.33s, Tests 1 passed (1), and /src/app/app.ts on port 5391 matches ɵɵdefineComponent. So the job's steps and the wasm engine work, and the Windows failure is about Windows.
  • CI run 47261854821: build succeeded in 13 min (including the pack and the upload); windows failed at vite build with the error above, after 40 s.
  • The new error message: node --test test/toolchain.test.mjs passes 6 of 6.
  • Docs: pnpm docs:check reports 16 options, 18 pages, 410 links, all in step. pnpm site:build passes.

Cost

  • The windows job: a Windows runner after build, 40 s while it stops at vite build.
  • The build job: one more pnpm build, two pnpm packs and an artifact upload. I didn't time these on their own.

Left open

🤖 Generated with Claude Code

ChristopherPHolder added a commit that referenced this pull request Dec 4, 2026
…ting entry

Every message with an entry on the Troubleshooting page ends with a second line,
See https://push-based.github.io/vite-plugin-ngp/troubleshooting/#<anchor>, from
seeTroubleshooting(). pnpm docs:check finds every call in the plugin's source and fails when the
page has no heading with that id, and when a page names one id twice.

Left without a link: the Angular CLI's fileReplacements message and @angular/localize's missing
translations, quoted word for word, and the native-engine and checker-exit messages, which open
pull requests #149 and #138 rewrite. Decision 88 records the choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChristopherPHolder and others added 2 commits December 4, 2026 09:58
The build job packs the plugin with its bundle and create-ngp; a windows-latest job scaffolds
app and app-ssr, sets engine: 'wasm', and runs the install, vite build, the spec and the servers.
It fails at vite build with TsconfigNotFound: the wasm engine reads paths by Unix rules. The
job is continue-on-error until it passes; Status says Windows doesn't work yet, and #148 has
the way out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows the missing-engine error said to set engine: 'wasm', which fails there before
compiling anything. It now says the plugin doesn't run on Windows yet and to use WSL 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChristopherPHolder

Copy link
Copy Markdown
Collaborator Author

LGTM. Checked: build packs the plugin (wasm engine asserted in the tarball) and create-ngp as an artifact; the windows job scaffolds, installs and runs both templates with engine: 'wasm', continue-on-error so the workflow stays green. It fails where the PR says: TsconfigNotFound("D:\\a\\_temp\\app\\tsconfig.app.json") — the wasm engine reads Windows paths by Unix rules. The win32 error message now points to WSL 2 instead of the wasm engine (test in toolchain.test.mjs). Fixed on the branch while rebasing: decision renumbered 86 → 87; the engine text reapplied to the restructured Configuration page (#169); Comparison/Creating an app/Vite+ Limits merged with main. Native engine follow-up: #148. Speed: no plugin cost; CI adds a pack + upload in build and ~40 s of a Windows runner.

@ChristopherPHolder
ChristopherPHolder merged commit 4b1dade into main Dec 4, 2026
2 of 3 checks passed
ChristopherPHolder added a commit that referenced this pull request Dec 4, 2026
…ting entry

Every message with an entry on the Troubleshooting page ends with a second line,
See https://push-based.github.io/vite-plugin-ngp/troubleshooting/#<anchor>, from
seeTroubleshooting(). pnpm docs:check finds every call in the plugin's source and fails when the
page has no heading with that id, and when a page names one id twice.

Left without a link: the Angular CLI's fileReplacements message and @angular/localize's missing
translations, quoted word for word, and the native-engine and checker-exit messages, which open
pull requests #149 and #138 rewrite. Decision 88 records the choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChristopherPHolder added a commit that referenced this pull request Dec 4, 2026
…nges on main

#149 found the wasm engine fails on Windows, and #168 renamed the Nx page's paths section. Link
the no-native-engine and checker-exit messages, now that #149 and #138 have landed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChristopherPHolder added a commit that referenced this pull request Dec 4, 2026
…ting entry (#172)

* docs(site): add a troubleshooting page for the plugin's errors and warnings

One page, grouped by where you meet a message, with each heading the message as printed or a
symptom, then what it means, why, what to do, and the page with the detail. It covers the plugin's
own messages, about 19 of which the docs never mentioned, and the failure modes spread over
Status, Nx, Creating an app, Compatibility, Configuration and Testing, each linking back. It ends
with how to make a minimal reproduction and file a bug. Configuration's table of startup errors
moved here, leaving a pointer.

The markdown renderer takes `### Heading {#id}` as the heading's id, so a link from outside the
site keeps working when the heading is reworded.


* feat(vite-plugin-ngp): link each error and warning to its troubleshooting entry

Every message with an entry on the Troubleshooting page ends with a second line,
See https://push-based.github.io/vite-plugin-ngp/troubleshooting/#<anchor>, from
seeTroubleshooting(). pnpm docs:check finds every call in the plugin's source and fails when the
page has no heading with that id, and when a page names one id twice.

Left without a link: the Angular CLI's fileReplacements message and @angular/localize's missing
translations, quoted word for word, and the native-engine and checker-exit messages, which open
pull requests #149 and #138 rewrite. Decision 88 records the choice.


* docs(site): point troubleshooting at the configuration option headings

#169 replaced configuration#when-to-change-them with a heading per option while this branch was
open; link engine, hmr and cache to their own headings.


* docs(site): bring troubleshooting in step with the windows and nx changes on main

#149 found the wasm engine fails on Windows, and #168 renamed the Nx page's paths section. Link
the no-native-engine and checker-exit messages, now that #149 and #138 have landed.


---------
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.

Run the plugin on Windows in CI with the wasm engine

1 participant