Skip to content

fix: enable demo fixture loading in dev mode#33

Merged
AmElmo merged 2 commits intomainfrom
AmElmo/load-demo-screenshots
Feb 25, 2026
Merged

fix: enable demo fixture loading in dev mode#33
AmElmo merged 2 commits intomainfrom
AmElmo/load-demo-screenshots

Conversation

@AmElmo
Copy link
Copy Markdown
Owner

@AmElmo AmElmo commented Feb 25, 2026

Summary

Fixed two critical issues that prevented the demo fixtures from loading when running the server with npm run dev:server:

  1. Package detection fails under ESM: getSpecWrightDir() used require() to read package.json, which silently fails in ESM mode with tsx. This caused the server to look in specwright/outputs/ instead of outputs/, creating a mismatch between the file watcher and fixture location.

  2. No standalone server entry point: web-server.ts only exports startWebServer() but doesn't call it when run directly, so tsx src/web-server.ts would load the module and exit.

These fixes ensure demo fixtures load correctly and enable taking website screenshots with the demo projects.

Changes

  • Replace require() with fs.readFileSync + JSON.parse in constants.ts
  • Add import.meta.url guard to auto-start server when run directly

…ne server entry

- Replace `require()` with `fs.readFileSync` + `JSON.parse` in
  `getSpecWrightDir()` so package.json detection works under tsx/ESM
- Add `import.meta.url` guard to web-server.ts so `tsx src/web-server.ts`
  actually starts the server
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec-wright Ready Ready Preview, Comment Feb 25, 2026 8:46am

The Codex CLI logo was a generic placeholder SVG. Replace it with the
actual OpenAI icon from Simple Icons, since Codex CLI is an OpenAI product.
@AmElmo AmElmo merged commit eb72ff3 into main Feb 25, 2026
10 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 25, 2026
## [3.6.3](v3.6.2...v3.6.3) (2026-02-25)

### Bug Fixes

* enable demo fixture loading in dev mode ([#33](#33)) ([eb72ff3](eb72ff3))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 3.6.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant