Closed FluffyDiscord closed 1 year ago
We have the same issue! Any fix? Happening on Windows
Looks like this is the culprit, and an arg is being passed here. That arg might not exist in prod.
Looks like this is the culprit, and an arg is being passed here. That arg might not exist in prod.
yes, I updated the post, however I have no idea how do I access the current running webpack instance, so I could pass the value there
I fixed this, but in a mediocore way, and it should be fixed natively in the library.
It looks the only value this library provides over the native commands is a simple wrapper. Primarily, it works on mac
in dev mode
, and the ability to debug effectively. Outside of that, it seemed to follow the Electron Docs in a fairly standard way.
So I changed it to be like this:
const { Deeplink } = isDev && isMac ? require("electron-deeplink") : require("./utils/deeplink");
And in my own deeplink file, I copied over the contents, and removed all the Mac Specific things and removed the weird command line args for Windows.
This ended up being broken to our customers, and I had wanted to ship a fix sooner than later. Will fallback to this library once this issue is resolved.
@glawson, is it possible you can make the process args for Windows an arg in the config? Or one of us could open a PR. Thanks a bunch.
@rlingineni @FluffyDiscord - sorry for the late response. Yes, I have time this weekend to do so.
@rlingineni or @FluffyDiscord, I have a branch with the fix if you wouldn't mind trying before I publish. npm install https://github.com/glawson/electron-deeplink.git#fixes-uncaught-on-windows
@rlingineni or @FluffyDiscord, I have a branch with the fix if you wouldn't mind trying before I publish.
npm install https://github.com/glawson/electron-deeplink.git#fixes-uncaught-on-windows
DIST environment now works. The REGEDIT path is set properly. yay
DEV environment is still not working.
Have you tried the "boilerplate" package at https://github.com/electron-userland/electron-webpack-quick-start
? It still fails to set proper path for DEV (electron-webpack dev
) and if I try to manually overwrite the REGEDIT key, deeplink then fails to set path
again (same issues as before was on DIST, I guess).
Would you mind looking into it ?
Incorrectly set DEV path
"C:\wamp64\www\ewqp\electron-webpack-quick-start\node_modules\electron\dist\electron.exe" C:\wamp64\www\ewqp\electron-webpack-quick-start\**--inspect=5858** "%1"
and I think the proper path should be
C:\wamp64\www\ewqp\electron-webpack-quick-start\node_modules\electron\dist\electron.exe --inspect=5858 C:\wamp64\www\ewqp\electron-webpack-quick-start\.webpack\main\index.js "%1"
but it fails once again with path
not found.
@FluffyDiscord - I didn't get a chance to today, I'll get to it tomorrow evening :)
Notes:
C:\Users\geofflawson\Desktop\electron-webpack-quick-start\node_modules\electron\dist\electron.exe --inspect=5858 C:\Users\geofflawson\Desktop\electron-webpack-quick-start\dist\main\main.js
errors with:
[HMR] Env ELECTRON_HMR_SOCKET_PATH is not set
this is from:
electron-webpack dev
starts webpack dev server. assuming that this is the dev server socket. with each run it's different:
process.env.ELECTRON_HMR_SOCKET_PATH=/tmp/electron-main-ipc-26a8.sock etc
Notes:
C:\Users\geofflawson\Desktop\electron-webpack-quick-start\node_modules\electron\dist\electron.exe --inspect=5858 C:\Users\geofflawson\Desktop\electron-webpack-quick-start\dist\main\main.js
errors with:
[HMR] Env ELECTRON_HMR_SOCKET_PATH is not set
this is from:
electron-webpack dev
starts webpack dev server. assuming that this is the dev server socket. with each run it's different:process.env.ELECTRON_HMR_SOCKET_PATH=/tmp/electron-main-ipc-26a8.sock etc
Then it's impossible for a dev environment to be functional, that's a shame.
@FluffyDiscord - I don't think it's impossible, I just need to figure out their webpack setup for dev. I might need to add an option where you can pass path and args to app.setAsDefaultProtocolClient(protocol[, path, args]) for Windows, and figure out what needs to change in the webpack config. With forge, I had to do a bit of config for dev: https://github.com/glawson/electron-deeplink-example/blob/master/package.json, but it works in dev on windows.
@FluffyDiscord - I need to catch up with this. Were you able to move forward?
@glawson No, in the end I didn't implement that feature in my personal app, because it was wonky at best eve when the app was build (but I would rather blame windows on it).
Was anyone able to resolve this issue? I am running into the same errors.
Was anyone able to resolve this issue? I am running into the same errors.
Yes, I moved away from a webpack as it was adding more and more issues. I am using Rollup now and things work just fine and it's compiling faster than with webpack. Also configuration is way simpler. The boilerplate I am using https://github.com/soulehshaikh99/create-svelte-electron-app you can follow the manual setup go switch existing project. You can skip the Svelte part and use your js framework
@Lermatroid - sorry for the late response, I'm out on vacation right now. I honestly need to re-look into this issue. When @FluffyDiscord updated me last back in 4/21 I was neck deep into another project and this became very back burner and dropped off my radar. I'll be back at it next week, the goal will be to make sure it's working with webpack. I'll update you soon.
All good, enjoy your vacation! Excited to see future updates and thanks for the awesome library!
I'm curious if you've had any discoveries on this?
Yeah, macos LaunchServices has changed a bunch, and node-gyp is out of date in this repo. I'm in the process of a v2 right now to deal with these changes.
happening with https://github.com/electron-userland/electron-webpack-quick-start
the
process.argv
contains following arguments when runningyarn dev
there are few issues with that, first, you are getting the parameter at index 1 and while the parameter from your example repo is
.
(local folder), in the webpack-quick-start it's--inspect=5858
, this fails setting up the registry key, as it makes it"C:\wamp64\www\ewqp\electron-webpack-quick-start\node_modules\electron\dist\electron.exe" C:\wamp64\www\ewqp\electron-webpack-quick-start\--inspect=5858 "%1"
instead of
"C:\wamp64\www\ewqp\electron-webpack-quick-start\node_modules\electron\dist\electron.exe" C:\wamp64\www\ewqp\electron-webpack-quick-start\ "%1"
this would be solved, if we could set our path in config, eg.
then the second issue is (still trying to solve), where I have no idea how do I access running webpack instance and send the link there
build - deeplink wont start
dev - starts but upon entering the protocol in browser url bar this error is thrown
regexp key value
"C:\wamp64\www\ewqp\electron-webpack-quick-start\node_modules\electron\dist\electron.exe" C:\wamp64\www\ewqp\electron-webpack-quick-start\--inspect=5858 "%1"