Skip to content

[BUG] TypeError when creating lodging: "can't access property images, g() is null" - UI not updated after successful POST #1069

@BaptisteWolff

Description

@BaptisteWolff

Bug Description

When creating a new lodging entry, a TypeError is thrown in the browser console immediately after the form is submitted. The lodging is successfully created in the database (the API returns a valid object), but the UI is not updated to display the new entry. A page reload is required to see it.

Console error:

Error saving lodging: TypeError: can't access property "images", g() is null

Steps to Reproduce

  1. Navigate to a collection
  2. Click to add a new lodging
  3. Fill in the required fields (name, check-in/check-out dates, type)
  4. Click Save
  5. Observe the console error — the new lodging does not appear in the list
  6. Reload the page — the lodging is present (it was correctly saved)

Expected Behavior

The lodging should be created and immediately appear in the UI without errors or requiring a manual page reload.

Screenshots / Logs

The POST /api/lodging/ returns a valid object:

{
  "id": "1387550f-b622-4a5d-8f51-98a99d327bb7",
  "name": "Test",
  "description": "",
  "check_in": "2026-05-15T00:00:00Z",
  "check_out": "2026-05-16T00:00:00Z",
  "type": "hotel",
  "is_public": true,
  "images": [],
  "attachments": [],
  ...
}

The issue is purely in the SvelteKit frontend — the returned object does not appear to be correctly injected into the component state after the POST, causing a null dereference when accessing .images.

Platform

Docker

Install Method

Docker Compose

AdventureLog Version

v0.12.0

Reverse Proxy

Nginx Proxy Manager

Docker Compose / Relevant Variables (Optional)

BODY_SIZE_LIMIT=52428800

Additional Context

This does not appear to be browser-specific (the error is a JS null dereference, not a Firefox-only behaviour). Tested on Firefox and Vivaldi.

After creation, the lodging appears under "Unscheduled items" instead of being attached to its scheduled date (May 15, 2026), despite check_in and check_out being correctly set in the API response.

Confirmation

  • I searched existing issues and confirmed this is not a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions