#Dynamic require of ... is not supported

9 messages · Page 1 of 1 (latest)

queen nexus
#

import { ipcRenderer } from 'electron' // Uncaught Error: Dyanmic require of 'electron' is not supported

not particually sure why i keep getting this error, happened multiple times in my code resulting in not being able to complete my project with diffrent libs ect so would like to get some clarification

not sure if its a ts issue or what but any help is appreciated

rough slate
#

the Dyanmic require of 'electron' part of the error lets me thing you are comiling your code to commonjs

#

check the electronjs docs to make sure it is supported, and that you should be using commonjs instead of esm

#

(esm imports are usually static, rather than dynamic)

#

@queen nexus

queen nexus
#

is there any docs that go into this in a bit more detail?

#

i dont really understand some of that haha

rough slate
queen nexus
#

not sure what to be looking for exactly, im using vite btw if it makes a diffrence