sonikjs / sonik

349 stars 9 forks source link

Window is not defined #3

Closed Sax-Yusuph closed 1 year ago

Sax-Yusuph commented 1 year ago

Hi, great work so far. I played with the react example a bit, and it looks amazing.

However, when trying a ui library (radix) on the island component, I get a window is not defined error. And in some cases the server crashes. I know this is WIP, just wanted to put it to your notice. Thanks.

yusukebe commented 1 year ago

Hi @Sax-Yusuph !

Thank you for trying out Sonik and bringing up the issue. I haven't tried integrating a UI library with React yet, but your observation is very valuable. I'll work on finding a way to support them!

yusukebe commented 1 year ago

@Sax-Yusuph

FYI, I can use the @radix-ui/themes with adding the following Vite settings:

export default defineConfig({
  ssr: {
    external: ['classnames']
  }
  // ...
})
Sax-Yusuph commented 1 year ago

Oh that's awesome... it works