Repository navigation
ci(workflows): run the packed plugin on windows with the wasm engine - #149
Conversation
0415d22 to
b82fd48
Compare
b82fd48 to
4a6b469
Compare
…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>
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>
4a6b469 to
3075788
Compare
|
LGTM. Checked: |
…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>
…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. ---------
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:create-ngpscaffoldsappandapp-ssr, andpnpm installinstalls the packed plugin.vite buildstops before compiling anything:Why: the wasm engine is built for
wasm32-unknown-unknown, so its Rust code reads paths by Unix rules. To it,D:\…andD:/…are relative paths. The plugin's entry tsconfigextendsthe 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:D:\a\_temp\app\tsconfig.app.json./D:/a/_temp/app/src/app/app. 56 fs callsD:/a/_temp/app/tsconfig.app.jsonincludebecomesD:/a/_temp/app/D:/a/_temp/app/src/**, then the engine walks the whole folder,node_modulesincluded. 12,401 fs calls/D:/a/_temp/app/tsconfig.app.json, with a host fs that drops the slash./app. 94 fs callsWhy 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-x64engine, with what each would take (Rust target, the bash/unameassumptions intoolchain/, the PE header inbundle.mjs, a runner).What changed
ci.yml,buildjob: afterbundle.mjs --host-only, it packs the plugin (--config.ignore-scripts, as create-ngp's tests do) and create-ngp, checks thatpackage/ngp/engines/wasm/ng_analyze_bg.wasmis in the tarball, and uploads both as thepackedartifact.ci.yml, newwindowsjob onwindows-latest,needs: build,continue-on-error: true:.nvmrc,package.jsonand.github/scripts, and doesn't build ngp.engine: 'wasm'invite.config.tsandvitest.config.ts, and runspnpm install,vite build,vitest run, a dev-server fetch, and forapp-ssrthe prerender check anddist/server/server.js..github/scripts/windows-app.mjs. Servers start withnode, not.cmdshims, so stopping the child stops them.ci.ymland not a new workflow: the packed plugin is an artifact ofbuild, and a separate workflow would have to build ngp again or hook ontociwithworkflow_run.continue-on-erroronce it passes.fix(vite-plugin-ngp): onwin32-*, the missing-native-engine error no longer says "Setengine: '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 intoolchain.test.mjs.engine: 'wasm'paragraph no longer lists Windows or says "works everywhere", and the error-table row is updated.design.md.How it was verified
appwith the packed create-ngp, and ranwindows-app.mjs prepare,pnpm install,pnpm run build,pnpm testandwindows-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.buildsucceeded in 13 min (including the pack and the upload);windowsfailed atvite buildwith the error above, after 40 s.node --test test/toolchain.test.mjspasses 6 of 6.pnpm docs:checkreports16 options, 18 pages, 410 links, all in step.pnpm site:buildpasses.Cost
windowsjob: a Windows runner afterbuild, 40 s while it stops atvite build.buildjob: one morepnpm build, twopnpm packs and an artifact upload. I didn't time these on their own.Left open
vite buildon Windows: the spec, the servers, and the plugin's own path handling between Vite and Node.🤖 Generated with Claude Code