#Error after import 'clipboard' from electron

1 messages · Page 1 of 1 (latest)

warm moth
#

i dont think this s because of importing clpboard

honest knot
#

@warm moth When I remove the import the error is gone. When I add it again, the error comes directly. I don't even use the clipboard but it happens right after I import clipboard.

warm moth
#

what packager you use?

#

to use es imports

honest knot
#

npm

#

or what do you mean?

warm moth
#

electron cant use import

#

so you need something that trasnform import to require

#

webpack or vite

#

or tsc if it typescript

honest knot
#

@warm moth i use vite

warm moth
#

then vite configure incorrectly

#

and its trying to import entire electron into your js file

honest knot
#

how can i fix this?

warm moth
#

setup vite properly