electron-pos-printer
electron-pos-printer copied to clipboard
ReferenceError: require is not defined
Hi, I am having a trouble where I can't print or preview the request
when printing it says "TimedOut" and when previewing the error in developer tools is
Uncaught ReferenceError: require is not defined at body-init.js:5
my electron webPreferences is
webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true, },
it seems the problem is with integration with electron 16 as fssonca's demo worked fine with me when upgrading to electron 16 it crashed.
Node: v16.13.1 electron: v16.0.2 electron-pos-printer: v1.2.4
You have to add the contextIsolation in BrowserWindow like:
webPreferences: {
contextIsolation: false,
}
as you can see my electron webPreferences is
webPreferences: { nodeIntegration: true, contextIsolation: false, enableRemoteModule: true, },
I set contextIsolation to false,
Hello @janafsal, @MahmoudMm and @buibr, Please excuse my late replies. You don't need to edit and recompile anymore, I have updated the package. It is compatible with the latest version of electron
Hello @janafsal, @MahmoudMm and @buibr, Please excuse my late replies. You don't need to edit and recompile anymore, I have updated the package. It is compatible with the latest version of electron
@Hubertformin thank you so much for your kind response…😊
You're welcome.