Skip to content

fix(site): say "not published" when site open has no published URL - #694

Merged
davidsu merged 1 commit into
mainfrom
fix/site-open-unpublished-message
Nov 9, 2026
Merged

davidsu merged 1 commit into
mainfrom
fix/site-open-unpublished-message

Conversation

@davidsu

@davidsu davidsu commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Note

Description

base44 site open on an app that was never published failed with "Error fetching site URL: App not found", which reads as if the app id were wrong. The published-URL endpoint only answers for live apps, so a 404 from it means "not published" — the command now says exactly that and hints at publishing. Any other lookup failure (e.g. a 500) still surfaces the server's own error unchanged.

Related Issue

Follow-up to #693 (BUG-893). Task: BASE-36419

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added AppNotPublishedError (code APP_NOT_PUBLISHED, a UserError) in packages/cli/src/core/errors.ts, with the message "This app has not been published yet, so it has no site URL" and a hint pointing at base44 deploy.
  • site open wraps getSiteUrl() in getPublishedSiteUrl(), which maps an ApiError with status 404 to AppNotPublishedError and rethrows every other error untouched.
  • Documented the new error code in the error-code table in docs/error-handling.md.
  • Added a Fixed entry to CHANGELOG.md.
  • Tests: the existing 404 case now asserts the new message, the base44 deploy hint, and the absence of "App not found"; a new 500 case asserts the server error still comes through and the "not published" wording does not.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The 404 → "not published" mapping lives in the site open command rather than in getSiteUrl(), so other callers of the URL lookup keep their current error behaviour. If more commands need the same treatment, the mapping is the natural thing to lift into core/project/.


🤖 Generated by Claude | 2026-11-04 18:55 UTC | b9f40b5

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.3.1-pr.694.631024e

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.3.1-pr.694.631024e"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.3.1-pr.694.631024e"
  }
}

Preview published to npm registry — try new features instantly!

netanelgilad
netanelgilad previously approved these changes Nov 5, 2026
`site open` surfaced the published-URL lookup's 404 as "Error fetching site URL: App not found", which reads as a wrong app id. The endpoint answers only for live apps, so a 404 there means the app was never published. The command now fails with AppNotPublishedError ("This app has not been published yet, so it has no site URL") and a hint to publish; any other lookup error passes through unchanged.

Task: https://b44sync.base44.app/rd-hub/tasks/BASE-36419
File: https://github.com/base44-dev/suss-tasks/blob/f43f67162bbbe2f43c461f10b31b2bbf13d3bc17/cli/exec_unpublished_app_not_found%F0%9F%9A%AA/site_open_not_published_message.md
gate: tests/cli/site_open.spec.ts

agent: exec.unpublished
@davidsu
davidsu merged commit 05a1d8b into main Nov 9, 2026
13 of 14 checks passed
@davidsu
davidsu deleted the fix/site-open-unpublished-message branch November 9, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants