Description
The npm run build command fails on Windows during the build:templates step with:
❌ Could not find tool content container markers
Root Cause
The build/inject-tool-templates.js script uses a hardcoded Unix-style line ending pattern (\n) to find the end marker in index.template.html. On Windows, files may have CRLF (\r\n) line endings, causing the pattern match to fail.
Environment
- OS: Windows 10/11
- Shell: Git Bash / PowerShell / CMD
- Node.js: v20+
Steps to Reproduce
- Clone the repo on Windows
- Run
npm install
- Run
npm run build
- Build fails at
build:templates step
Suggested Fix
Add fallback pattern matching for Windows line endings while preserving the original Unix behavior. I've prepared a PR with a backwards-compatible fix.
Workaround
Users can manually convert index.template.html to Unix line endings using:
dos2unix index.template.html
But a proper fix in the build script would be preferable for cross-platform compatibility.
Description
The
npm run buildcommand fails on Windows during thebuild:templatesstep with:Root Cause
The
build/inject-tool-templates.jsscript uses a hardcoded Unix-style line ending pattern (\n) to find the end marker inindex.template.html. On Windows, files may have CRLF (\r\n) line endings, causing the pattern match to fail.Environment
Steps to Reproduce
npm installnpm run buildbuild:templatesstepSuggested Fix
Add fallback pattern matching for Windows line endings while preserving the original Unix behavior. I've prepared a PR with a backwards-compatible fix.
Workaround
Users can manually convert
index.template.htmlto Unix line endings using:But a proper fix in the build script would be preferable for cross-platform compatibility.