blackboardsh / electrobun

Build ultra fast, tiny, and cross-platform desktop apps with Typescript.
https://www.electrobun.dev
MIT License
326 stars 5 forks source link

Menu component does not work in ElectroBun environment. #26

Closed janckerchen closed 20 minutes ago

janckerchen commented 2 hours ago

The following code works fine in the browser environment, but does not work in the ElectroBun environment.

import {Provider} from '@/components/ui/provider'
import {
  MenuContent,
  MenuItem,
  MenuRoot,
  MenuTrigger,
} from '@/components/ui/menu'
import {Button} from '@/components/ui/button'

export const App = () => (
  <Provider>
    <MenuRoot>
      <MenuTrigger asChild>
        <Button variant='outline' size='sm'>
          Open
        </Button>
      </MenuTrigger>
      <MenuContent>
        <MenuItem value='new-txt'>New Text File</MenuItem>
        <MenuItem value='new-file'>New File...</MenuItem>
        <MenuItem value='new-win'>New Window</MenuItem>
        <MenuItem value='open-file'>Open File...</MenuItem>
        <MenuItem value='export'>Export</MenuItem>
      </MenuContent>
    </MenuRoot>
  </Provider>

)

system environment

bun  1.1.33
"electrobun": "^0.0.15",
"@chakra-ui/react": "^3.0.2",

Error

image
YoavCodes commented 2 hours ago

Would be helpful for you to create a minimal repro and share a zip file or github project with it.

i suspect this is either:

I’ve heard of chakra-ui issues when the bundler doesn’t handle cyclical imports in a certain way.

janckerchen commented 20 minutes ago

I have submitted the issue to chakra-ui.