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

  1. Removed generateProductDetailHTML() entirely (not used anywhere β€” OG tags are injected via serveIndexWithOG β†’ generateProductOgHead()).
  2. 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
Publish this branch
This branch is in draft mode, publish it to be able to merge.

Sign up or log in to comment