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

window property undefined when creating artifact preview #5

Open
Janldeboer opened this issue Oct 5, 2024 · 0 comments
Open

window property undefined when creating artifact preview #5

Janldeboer opened this issue Oct 5, 2024 · 0 comments

Comments

@Janldeboer
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant