Closed jzellis closed 1 year ago
Hey @jzellis 👋
can you link a repo so I can check out your project? I don’t know this setup so I’d have to check that out first.
Best regards
Simon
hey @s1hofmann i have the same problem. here is a repo: https://github.com/esteban-url/nextron-nutjs
very straight forward. the mouse does move but the page breaks. please let me know if I can help in some other way
yarn install
yarn dev
Hi @esteban-url 👋
You are calling nut.js inside your render process, which should be avoided.
You can see that this has a side-effect during build, when the cursor starts bouncing. Additionally, and this is the core of your problem, nut.js is a node package, so it's not suitable to be imported in a web context.
Instead, move calls to nut.js to your main process and switch to IPC communication between both processes. See this nextron example as a starter.
Best regards
Simon
@jzellis I'm assuming you're hit by the same problem, but without a repo I can't tell 🤷♂️
thanks for pointing me in the right direction @s1hofmann. it's working now!
Hello! I'm trying to use Nut with Nextron (Electron + Next.js), but I'm getting the following error whenever I attempt to include the
keyboard.type
function in my code:The odd part is that I don't get it if I just do
import { keyboard } from '@nut-tree/nut-js';
-- it's only if I actually include thekeyboard.type
function in my code. Even weirder is that it errors out on startup, not when the function would be called.I'm a newbie to Electron development in general, so maybe I'm missing something obvious. I tried searching for this and found #250 , but that's using Vue and Vue's config files.
Anybody have any idea where I might start on fixing this? I'm building a little app that lets me assign custom key commands to MIDI events coming from a macropad I've built, and Nut.js seems to be the best (possibly only) solution for doing this in Electron.
Thanks!