svelte-ace
svelte-ace copied to clipboard
window is not defined error when using svelte-ace and trying to display json code
Hello, I have a svelte app using sveltekit and I am trying to display a js object as json code (just like GPT does when showing you code). But I always encounter this error :
ReferenceError: window is not defined
Here is my code, can you give me any tips ? Thank you very much !
`
export let entry;
`
<Card class="entry_card"> <Content class="card_content"> <h4>{entry.input}</h4> <p>Summary: {entry.summary}</p> <p>Query: {entry.sqlRequest}</p> <AceEditor lang="json" value={JSON.stringify(entry.data)}/> </Content> <Actions> <ActionButtons> <IconButton class="material-icons" style="flex-basis: 25%; color: orange;" >star_outlined</IconButton> </ActionButtons> </Actions> </Card>
(Sorry for the formating git editor was causing problems)
Having the same issue.
How did you guys solve this?
How did you guys solve this?
Hey, I tried but could not solve it, I did not need to display json in the end so I just let it go.