Skip to content

hs cms theme preview shows HubSpot's login page instead of rendered templates/modules #1632

Description

@igdaloff

CLI Version

8.12.0

Node.js Version

26.7.0

Operating System

MacOS 26.6.2

Description

Environment: @hubspot/cms-dev-server 1.2.44, classic CMS theme project (not Projects/React), account authenticated via personal access key.

Problem: Running hs cms theme preview and opening any template or module locally returns HubSpot's actual login page instead of the rendered content, even though the CLI account is fully authenticated, and I'm also logged into HubSpot in the same browser I'm previewing in.

The same login page also shows up when clicking into modules in the browser preview UI. Again, despite being logged into HubSpot in that same browser the whole time.

Impact: Local dev with live data is effectively unusable for classic CMS themes; only static/dummy-data views work.

Steps to Reproduce

  1. hs cms theme preview <src> <dest>
  2. Go to https://hslocal.net:3000/ in browser
  3. Click "View Local Version" for any module or template
  4. Notice that a "This login URL is invalid." page appears, even though I'm logged in. When curling to the page, it returns HTTP 200 with <title>HubSpot Login and Sign in</title>. No browser or cookies involved, so it's not a browser-session issue. The local preview server appears unable to authenticate its own requests to HubSpot's rendering backend using the CLI's existing auth.

Expected Behavior

I should be able to view module or templates in my browser using CMS/server data with local module or template code.

Screenshots

Image

Debug Output

Ran with --debug enabled and hit the failing route directly. Note: --debug doesn't add any logging for the actual failing request — the only debug output is CLI startup noise (config reads, usage tracking). The failure is completely silent, even in debug mode.

Startup log:
Loading HS auth (account = 6899630) configuration at: ~/.hscli/config.yml
'hsproject.json' not found in any parent of dev server target
Unable to find local hsproject.json, skipping platform version validation.
Comparing files for refreshed session...
No package.json at theme-v5

HubSpot CMS dev server running at https://hslocal.net:3002, hubid=6899630

Request/response for the failing route:
GET https://hslocal.net:3002/template/hs-theme-v5/templates/default.html

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: text/html; charset=utf-8
Body returned is the full HubSpot login page (<title>HubSpot Login and Sign in</title>) — 200 status, no error, no indication anything went wrong.

Reproduces consistently on a completely fresh dev server instance (tested on a second, freshly started instance on a separate port), so it's not a stale session/token issue.

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