Skip to content
This repository was archived by the owner on Oct 6, 2024. It is now read-only.
This repository was archived by the owner on Oct 6, 2024. It is now read-only.

window property undefined when creating artifact preview #5

@janldeboer

Description

@janldeboer

When I'm asking the model to create an interactive, it will correctly write the code (I tried examples with React and Python), but the preview stays empty.

In the terminal, I get this error:

 ⨯ lib/userSettings.ts (21:26) @ window
 ⨯ ReferenceError: window is not defined
    at getSettings (./lib/userSettings.ts:24:28)
    at UserSettings (./components/side-navbar/user-settings.tsx:29:86)
digest: "1113809737"
  19 |
  20 | export const getSettings = (): SettingsSchema => {
> 21 |   const storedSettings = window.localStorage.getItem(settingsLocalStorageKey);
     |                          ^
  22 |
  23 |   if (!storedSettings) {
  24 |     return defaultSettings;
 GET /new 500 in 2788ms

I'm running it on macOS with Apple Silicon.

I will have a look on it and see if I can fix it or at least provide further information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions