Closed Rostov4an1n closed 8 months ago
I saw a Roadmap for future updates of this project, where everything will be fixed. Could you tell me when to expect a future update?
My team and I are also facing the same issue. It would be helpful if we could see a working project
Check out the official Electron examples on IPC communication, specifically this section on communication from the renderer to the main process: https://www.electronjs.org/docs/latest/tutorial/ipc#pattern-2-renderer-to-main-two-way
Here's the code for it: https://github.com/electron/electron/tree/v27.0.0/docs/fiddles/ipc/pattern-2
That example isn't identical, but it's close: you just need to swap out the logic in the main process where the example opens a native file dialog and instead call app.quit()
. The principles are identical though.
Happy to help debug any code either of you have got which isn't working once you get close.
I am importing electron as shown in the example . But I am getting the following error
here is my background.ts
import { app, ipcMain } from 'electron'
import serve from 'electron-serve'
import { createWindow } from './helpers'
const isProd: boolean = process.env.NODE_ENV === 'production'
if (isProd) {
serve({ directory: 'app' })
} else {
app.setPath('userData', `${app.getPath('userData')} (development)`)
}
; (async () => {
await app.whenReady()
const mainWindow = createWindow('main', {
width: 1000,
height: 600,
minWidth: 960,
minHeight: 600,
})
if (isProd) {
await mainWindow.loadURL('app://./home')
} else {
const port = process.argv[2]
await mainWindow.loadURL(`http://localhost:${port}/home`)
// mainWindow.webContents.openDevTools()
}
})()
app.on('window-all-closed', () => {
app.quit()
})
ipcMain.on('ping-pong', (event, arg) => {
event.sender.send('ping-pong', `[ipcMain] "${arg}" received asynchronously.`)
})
Maybe https://github.com/saltyshiomix/nextron/issues/396#issuecomment-1756059475 can help. Try change renderer settings
I am importing electron as shown in the example . But I am getting the following error
Greetings. I have the same problem. The developer of this repository said that he will fix IPC-Communication in the next update
I'll fix the bug soon, sorry for inconvenience 🙇
@Rostov4an1n CC: @abrarabedin001 @pixkk
Nextron v8.12.0 is out! Now it supports preload script for secure IPC features :)
If you have time, please try new examples:
npx create-nextron-app test-app --example basic-lang-typescript
thanks for letting us know. Will check it out soon.
@saltyshiomix Thank you very much for the work done! I was able to positively connect the functions of interaction with the buttons of the upper panel of the application via IPC Electron. If I knew how, I could attach a video video evidence 😁🎉
@Rostov4an1n CC: @abrarabedin001 @pixkk
Nextron v8.12.0 is out! Now it supports preload script for secure IPC features :)
If you have time, please try new examples:
npx create-nextron-app test-app --example basic-lang-typescript
download temp error~
PS E:\project\nextrons> npx create-nextron-app my-app --example basic-lang-typescript
Need to install the following packages:
create-nextron-app
Ok to proceed? (y) y
✔ Validating existence...
⠇ Downloading and extracting...node:events:368
throw er; // Unhandled 'error' event
^
RequestError: connect ETIMEDOUT 20.205.243.165:443
at ClientRequest.
@Rostov4an1n CC: @abrarabedin001 @pixkk
Nextron v8.12.0 is out! Now it supports preload script for secure IPC features :)
If you have time, please try new examples:
npx create-nextron-app test-app --example basic-lang-typescript
RequestError: connect ETIMEDOUT 20.205.243.165:443
Check your internet connection (or disable/enable VPN for downloading packets).
The issue Still Persist , Nothing changed.
Here is the Error:
The issue Occur after the import of "IpcRenderer"
Here are my dependencies:
@saltyshiomix Kindly look into this.. I have used the electron-react-boilerplate where they wrap the ipc into some kind of API or simple callback functions. Also doing some communication stuff useing electron-store. But I'm still unable to understand your method for communication. Can you please update some documentation at least for some basic things.
Tell me how you can fix the problem. I created a custom top panel where the close, collapse, expand buttons are located. I want to use the example of the close button to send an IPC, which will close the application when pressed.
But when I tried to download the IPC-communication application template, I was faced with the fact that it does not work.
Can you tell me how to send IPC signals? If you would provide an example of a solution to my problem, then I would be very grateful to you