Skip to content

Migration leaves runtime-breaking artifacts unconverted (string style, asset(), ctx.get, platform, dropped Tailwind palette, corrupted ternaries, …) #369

Description

@JonasJesus42

Summary

Catalog of runtime-breaking artifacts the Fresh→TanStack migration left behind (found porting deco-sites/montecarlo-tanstack). Each one crashed SSR/hydration until fixed by hand. The migration transforms should convert or at least flag these; today they pass through silently and break the build/render.

Artifacts found (all fixed manually in the site)

  1. String style props (Preact allows, React rejects) — style="a: b", style={"..."}, style={\...`}across ~15 files (Header minicart, Slide, Spacing, Partners, LeadsForm, ProductVariantSelector, BuyTogether, ImageSlider, newsletter popups, GTM). React throws *"Thestyle` prop expects a mapping … not a string"* and kills the section.
  2. asset() Fresh globalsrc/sections/Fonts/Fonts.tsx used asset(font.source) (from $fresh/runtime), undefined in TanStack → ReferenceError: asset is not defined.
  3. import.meta.resolve(...) — unsupported in the Workers module runner (Searchbar.tsx), crashes dev at load.
  4. platform globalminiCart/Cart.tsx used if (platform === "vtex") with the apps/storefront.ts import commented out → ReferenceError: platform is not defined.
  5. ctx.get({ __resolveType: "resolvables" }) — deco-cx runtime API with no @decocms/blocks equivalent (ProductShelf.tsx) → Cannot read properties of undefined (reading 'get').
  6. ctx.response — not present on the new FnContext (sections/Theme/Fonts.tsx) → SSR crash.
  7. useComponent / sections/Component — HTMX dynamic-section helper deleted, still imported (Searchbar, Suggestions) → unresolved module.
  8. Duplicate imports — same identifier imported twice (ImageWidget in SearchResult.tsx) — passes esbuild, fails babel-react-compiler.
  9. Corrupted ternaries in template-literal classNames — the ${} closing brace was moved into the first branch (\... ${a ? "x"} : "y"`) in Filters.tsx, Aside.tsx, Slide.tsx, PriceFiltersIsland.tsx` → syntax errors.
  10. Dropped custom Tailwind palette — the v4 @theme reset --color-*: initial but the site's custom colors (perola, perola+, perola-intermediario, …) from the old tailwind.config.ts were never ported → @apply fails: "Cannot apply unknown utility class".
  11. Broken template literalFonts.tsx had "/styles.css?revision=${await ""}" (invalid) emitted by the migration.
  12. HTMX residue — the 22 manual-review items in MIGRATION_REPORT.md (hx-* attributes across search filters, ProductGallery, ProductVariantSelector, etc.) still need React conversion.
  13. React key warnings — ~100 Each child in a list should have a unique "key" warnings (Slider/ShelfCollection/…), pre-existing but noisy.

Ask

Extend the blocks-cli transforms to convert (or explicitly flag in the report) items 1–6, 8–11; and keep the HTMX (7, 12) items in the manual-review list (already partially done). Even a deco-post-cleanup rule for string style → object and asset()/import.meta.resolve/platform removal would prevent every migrated site from hitting these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions