Skip to content

[Bug?]:TypeError: Cannot read properties of undefined (reading 'metadata') #2328

Closed as not planned

Description

@Hritik-Kumar-dev
Image

Activity

  1. brenelz commented on Sep 27, 2026

    @brenelz
    Contributor

    Looks like this version is using vinxi. Can you upgrade to solid start 2.0 and see if it fixes it

  2. lxsmnsyc commented on Oct 13, 2026

    @lxsmnsyc
    Member

    This error comes from @tauri-apps/api, not from SolidStart, and it does not depend on the SolidStart version.

    The screenshot shows getCurrentWebviewWindow() being called while Inner2 renders (app.tsx:5:25). It reads window.__TAURI_INTERNALS__.metadata, and window.__TAURI_INTERNALS__ is undefined. Only the Tauri runtime adds that object to the page. The page in the screenshot is open at localhost:3002 in a regular browser tab, not inside a Tauri window, so any Tauri window API throws there. SolidStart's dev overlay only displays the error. The same code throws on SolidStart 2.0, and in a plain Vite app.

    To make the app work in both places:

    • Check that you are running inside Tauri before calling Tauri APIs. isTauri() from @tauri-apps/api/core does this.
    • Call them on the client after the component mounts, for example in onMount or inside a clientOnly component. During server rendering there is no window at all.
    import { isTauri } from "@tauri-apps/api/core";
    import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
    import { onMount } from "solid-js";
    
    function Inner() {
      onMount(() => {
        if (!isTauri()) return;
        const win = getCurrentWebviewWindow();
        // use win
      });
      // ...
    }

    Closing, since this is not a SolidStart bug. If you see this error inside the Tauri window itself, please reopen with a small reproduction.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions