Commit Graph

2 Commits

Author SHA1 Message Date
c3f301b799 Fix Alpine setup to patch transformers backend directly
Instead of creating a stub onnxruntime-node module, patch the
@xenova/transformers backend file to skip the onnxruntime-node
import entirely and use only onnxruntime-web.

This prevents the "Cannot read properties of undefined" error
when the library tries to use the Node backend in a Node.js
environment but only has the web backend available.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:44:02 -06:00
28f5d83d67 Add Alpine Linux support via stub onnxruntime-node module
The @xenova/transformers package unconditionally imports both
onnxruntime-node and onnxruntime-web at module load time. This
causes immediate failure on Alpine Linux (musl libc) because
onnxruntime-node requires glibc.

Solution: Created alpine:setup script that replaces onnxruntime-node
with a stub module after npm install. The transformers library will
automatically fall back to onnxruntime-web (WASM backend).

Usage on Alpine:
  npm install
  npm run alpine:setup
  npm run build
  npm run index:all

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:41:05 -06:00