-
-
Notifications
You must be signed in to change notification settings - Fork 193
Broadcasting Event with Electron IPC System not working #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can't reproduce since I can't serve my app in 0.4 version but this how I log every events. Hope it'll help somebody :) window.addEventListener('livewire:load', () => {
// Sometimes not handled by Native with Livewire 🤷
window.Livewire.addHeaders({
'X-NativePHP-Secret': '{{ config('nativephp-internal.secret') }}',
})
window.Echo.channel('nativephp')
.subscribed(() => console.info('Subscribed to nativephp channel'))
.error((error) => console.error(error))
// Not in Echo public API but works 😉
.listenToAll((event, payload) => {
console.log(event, payload)
// See https://github.com/NativePHP/electron-plugin/blob/main/src/preload/index.ts
//window.Livewire.emit(event, payload)
})
/** @type {Electron} */
const remote = window.remote;
// Helps me to keeping track of the window load
remote.shell.beep()
remote.ipcMain.on('native-event', (_, data) => {
console.log(data);
});
}) |
Hello, Can you help me? I want to listen from event from livewire, But it's not working. |
@mho22 I know this was from a while ago, but can you give some context around what you were trying to achieve? |
@simonhamp As I remember, I wanted to catch events from clicking on a subMenu. I remember trying out what is written in this part of the documentation but it didn't work for me. I think it was related to the DOOM Native PHP side project : I think I was trying to load different games from the menubar. I can see that the documentation hasn't changed. But I don't know if the issue is outdated or not. I can try to reproduce the issue again in the next days if you want. |
Fixed by #367 @simonhamp? |
I think it will be. Thanks for digging through related issues @gwleuverink 😇 @mho22 @MarceauKa @Nuhel the PR that Willem linked will be released next week. Please try that out at your leisure. In the meantime, I'm going to close this issue |
What happened?
Two things don't actually work or exist from the NativePHP documentation.
ipcRenderer
exported from@electron/remote
package. There is only aipcMain
Event Emitter.-> This could be replaced in the documentation by
How to reproduce the bug
npm install @electron/remote
Package Version
0.4.0
PHP Version
8.1.21
Laravel Version
10.18.0
Node Version
18.10.0
Which operating systems does with happen with?
macOS
Notes
I tried to correct the error with
vite-plugin-node-polyfills
. No more warning butfs
wasnull
.The text was updated successfully, but these errors were encountered: