WorldEditAxe / eaglerproxy

A standalone implemention of the BungeeCord plugin for EaglercraftX, now with online vanilla server support!
38 stars 93 forks source link

Illegal instruction (core dumped) #23

Closed dxomg closed 3 months ago

dxomg commented 8 months ago

I just did the steps to install found on the README.md and got Illegal instruction (core dumped) as an error when executing node index.js found at ~/eaglerproxy/build

Important stuff?

root@dxomg2:~# nodejs -v
v18.13.0
root@dxomg2:~# npm -v
9.2.0
root@dxomg2:~#
WorldEditAxe commented 8 months ago

eaglerproxy uses sharp, a NPM library with native dependencies. Is it possible for you to remove it from the project's dependencies and try again?

dxomg commented 8 months ago

eaglerproxy uses sharp, a NPM library with native dependencies. Is it possible for you to remove it from the project's dependencies and try again?

I tried removing it from package.json and just got (I saw no point it doing this, but this is what you asked me to do I suppose)

node:internal/errors:496
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'sharp' imported from /root/eaglerproxy/build/proxy/Motd.js
    at new NodeError (node:internal/errors:405:5)
    at packageResolve (node:internal/modules/esm/resolve:887:9)
    at moduleResolve (node:internal/modules/esm/resolve:936:20)
    at defaultResolve (node:internal/modules/esm/resolve:1129:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
dxomg commented 8 months ago

I ended up solving the issue, apparently you have to remove import sharp from "sharp"; /src/proxy/Motd.ts and /src/proxy/skins/EaglerSkins.ts (I miss understood what you said at first), Thanks anyways!

dxomg commented 8 months ago

Apparently it only works after you've made the code NodeJS so you'd have to modify /build/proxy/Motd.js and /build/proxy/skins/EaglerSkins.js

WorldEditAxe commented 8 months ago

This issue still constitutes as a unresolved one because the nature of the issue. Anyway, this crash should be reported to the developers of sharp, not me. This proxy uses sharp to create player skins and server MOTD images and send them over the wire, and switching to an alternate solution that utilizes pure JS would kill performance. Unless this can't be resolved by sharp, I will not add a serialization mode that utilizes pure JS.

dxomg commented 8 months ago

¯\_(ツ)_/¯ sharp didn't work on any of my devices that I tried (an old Dell laptop, and a newer Intel Celeron laptop) which are both x86_64 architecture, I do have a raspi but I didn't test it there as a fear that aarch64 may break things.

dxomg commented 8 months ago

Also because I removed sharp, when clients join the proxy I get spammed with errors saying sharp is not defined, I guess its ok for a quick fix but should be fixed by the library maintainers I suppose.

4|index  | W 2023-10-24T00:22:26.331Z SkinServer: Failed to fetch skin URL http://textures.minecraft.net/texture/b77d30d599ca99159f6b82dbb1599c57fdbae76d2dc5b5971f7d4cb0fead4b44 for player fermalbet: ReferenceError: sharp is not defined
4|index  |     at Object.toEaglerSkin (file:///root/eaglerproxy/build/proxy/skins/EaglerSkins.js:160:22)
4|index  |     at SkinServer.handleRequest (file:///root/eaglerproxy/build/proxy/skins/EaglerSkins.js:260:123)
4|index  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
4|index  |     at async Player.<anonymous> (file:///root/eaglerproxy/build/proxy/Proxy.js:270:25)
WorldEditAxe commented 8 months ago

I'll see if I can make a pure-JS only skin server

dxomg commented 8 months ago

alright

WorldEditAxe commented 3 months ago

Done - successfully implemented

dxomg commented 3 months ago

Well that took a while