Spaces:
Running
Running
fix: Bun v1.3.14 compile error β remove nested template literal in generateProductOgHead()
#2
by bep40 - opened
Problem
Bun v1.3.14 crashes on line 193: Unexpected * because generateProductDetailHTML() uses a template literal containing <style> block with CSS rules. Bun's parser chokes on nested template literal strings.
Additionally, generateProductOgHead() uses nested template literals which may also cause Bun parse errors.
Fix
- Removed
generateProductDetailHTML()entirely (not used anywhere β OG tags are injected viaserveIndexWithOGβgenerateProductOgHead()). - Rewrote
generateProductOgHead()to use ONLY+string concatenation β no nested template literals, no backtick strings for inner values.
Result
- Bun compiles successfully
- Share links (
?product=xxx) still inject OG tags for Facebook/Zalo/Telegram previews - No change to functionality