shapez.io icon indicating copy to clipboard operation
shapez.io copied to clipboard

Problem when bundling with NodeJS > 16

Open Higgs1 opened this issue 1 year ago • 1 comments

Hello,

I'm sorry if this has been mentioned or addressed elsewhere. I'll try to keep this brief.

When trying to compile the game on my system (yarn, yarn, yarn gulp), the browser opened but it was unable to load bundle.js (404). This is because it was never created. I didn't really dig too much into it because I already knew what the problem was. I'm using Node > 16. NodeJS 17 (AFAIK) upgraded to OpenSSL3, which changed the initialization context of md family (compared to the older version of OpenSSL, which NodeJS 16 uses). Setting the environment NODE_OPTIONS=--openssl-legacy-provider switches this back to how it works in Node 16, and now I'm able to successfully compile the game in all the versions of Node I tested (including master).

There are several things that could be done:

  • Take the instructions literally and just use Node 16. "But I wanna use Node x!"
  • Add a note about NODE_OPTIONS=--openssl-legacy-provider in the instructions. (this sounds simplest?)
  • Add NODE_OPTIONS=--openssl-legacy-provider to all builds, since it doesn't affect older versions of Node.
  • Monkey patching the crypto for md4 modules (pls no).
  • Tell me that I've completely missed something because I'm a dummy.

Thank you for your time (and very fun game), HTH.

Higgs1 avatar Aug 11 '22 01:08 Higgs1

fear not! this issue has been known for over half a year, and you're doing the right thing. Yes, shapez issue management is kinda all over the place.

EmeraldBlock avatar Aug 11 '22 01:08 EmeraldBlock