hathora / builder

Multiplayer game framework

Home Page:https://docs.hathora.dev/#/builder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need to specify a minimum node version

vyder opened this issue · comments

commented

My global node version was 14.15.0, running hathora dev crashed with this error:

up to date in 0.109s
(node:15544) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected string to be returned for the "format" from the "loader getFormat" function but got type object.
    at Loader.getFormat (internal/modules/esm/loader.js:110:13)
    at async Loader.getModuleJob (internal/modules/esm/loader.js:230:20)
    at async Loader.import (internal/modules/esm/loader.js:164:17)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  code: 'ERR_INVALID_RETURN_PROPERTY_VALUE'
}

After some googling, I came across a stack overflow that talked about upgrading node version.

So when I switched to node 16.13.0, it worked just fine.

Specifying a .nodenv and .nvmrc file in the tutorial repos would fix the short-term issue. (You can symlink one to the other to keep them in sync)

I didn't dig in to what feature is necessary for the build to pass, to track down the minimum node version, but just documenting it as an issue here.

I specify the minimum node version in the docs and also in the engines section of package.json, which should warn you if your node version is too low when you install/upgrade hathora (but I know most people ignore install output).

The CI also verifies that is passes on node 16.x and 17.x (I need to add 18.x there too).

I have an .nvmrc file in this repo but agreed that it should be in the tutorial repos too, thanks for your PR there!

I think having this issue could help others who come searching for the same error message, so that's already an improvement. Closing this for now but let me know if you can think of other ways to improve the docs/enforcement around the minimum node version.