Skip to content

hs cms theme preview does not respect JavaScript-based fields (fields.js) #1604

Description

@dawid-kokoszka

CLI Version

8.5.0

Node.js Version

22.21.1

Operating System

macOS 26.4.1

Description

Write module and theme fields using JavaScript (https://developers.hubspot.com/docs/cms/start-building/building-blocks/fields/write-fields-using-javascript)

hs cms theme preview does not respect JavaScript-based fields (fields.js)

Primary problem:

The hs cms theme preview CLI command does not appear to process or convert JavaScript-based field definitions (fields.js / .cjs / .mjs). As a result, the local preview does not render fields correctly for themes/modules that use JS-authored fields.

Actual behavior:

The local preview does not render the fields defined in fields.js. It seems the command only reads fields.json and ignores JS field files.

Steps to Reproduce

  1. Create a theme/module that defines fields usingfields.js(nofields.json).
  2. Run hs cms theme preview .
  3. Open the local preview URL

Expected Behavior

hs cms theme preview should evaluate fields.js (similar to how hs upload / hs watch do with --convertFields) and render the local preview using the resolved field values.

Screenshots

No response

Debug Output

No response

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions