Skip to content
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

Loading a Plugin locally, fail to import dependencies with "require" #7913

Open
2 tasks done
ndesgranges opened this issue Apr 25, 2024 · 1 comment
Open
2 tasks done

Comments

@ndesgranges
Copy link

ndesgranges commented Apr 25, 2024

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: MacOS Sonoma 14.4.1
  • Hyper.app version: v3.4.1
  • Link of a Gist with the contents of your hyper.json: here
  • Relevant information from devtools (CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere): N/A
  • The issue is reproducible in vanilla Hyper.app: yes

Issue

context

I'm trying to improve a plugin (hyper-day-night-switch). To do so, I :

  • forked the sources and (index.js, package.json, README.md),
  • added a symlink to the folder in ~/.hyper_plugins/local,
  • added "hyper-day-night-switch" in my ~/.hyper.jsin the localPlugins array

The problem

✅ The plugin, loads properly if I use the npmjs version (original, adding hyper-day-night-switch into plugins).
🔴 But won't load locally (using the forked sources, adding hyper-day-night-switch into localPlugins.

The devtools won't output anything. Though, I could get what's happening running hyper -v :

Plugin error while loading "hyper-auto-dark-mode" (/Users/<me>/.hyper_plugins/local/hyper-auto-dark-mode): Cannot find module 'hyper-one-light'
Require stack:
- /Users/<me>/Documents/Projets/hyper-auto-dark-mode/index.js
- /Applications/Hyper.app/Contents/Resources/app.asar/plugins.js
- /Applications/Hyper.app/Contents/Resources/app.asar/index.js
- 

The require is triggered by this line :

const light = require("hyper-one-light");

I tried adding those modules in plugins so I know it's there : did not work.
Also tried an npm install in ~/hyper_plugins, I can see the dependencies going into modules but, still the same issue.

NOTE

I'm not using the dev version cause on MAC I'm getting the following error, with all npm versions I tried, even though I'm not behind a proxy and I can ping the address.

EDIT : I now am, see #7913 (comment)

RequestError: connect EBADF 140.82.121.4:443
   at ClientRequest.<anonymous> (/Users/<me>/.hyper_plugins/hyper-dev/hyper/node_modules/@electron/get/node_modules got/dist/source/core/index.js:970:111)
    at Object.onceWrapper (node:events:632:26)
    at ClientRequest.emit (node:events:529:35)
    at origin.emit (/Users/<me>/.hyper_plugins/hyper-dev/hyper/node_modules/@electron/get/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at TLSSocket.socketErrorListener (node:_http_client:501:9)
    at TLSSocket.emit (node:events:517:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
  code: 'EBADF',
@ndesgranges
Copy link
Author

ndesgranges commented Apr 27, 2024

So I managed to build hyper in dev mode on Mac OS

For anyone having the issue described in section NOTE, for me it was LuLu messing with npm, had to disable it to build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant