Quenty/NevermoreEngine

Attempted to call require with invalid argument(s)

unrooot opened this issue · 2 comments

Describe the bug
It seems like after installing specific packages (or rather, randomly when you install packages) the loader will fail to require them and output the error "Attempted to call require with invalid argument(s)".

To Reproduce
Not entirely certain of repro steps, but after some discussion in the Discord, the consensus seems to be that it sometimes happens when installing packages. It has happened with spritesheet, gameconfig, playerbinder, and observablecollection - although it does not seem to be specific packages, as installing them on other projects will usually work without any problems. Another person pointed out how bugged packages are streamed in with an extra node_modules.

Expected behavior
This error should not occur after installing a new package.

Screenshots
CleanShot 2023-11-08 at 21 03 26@2x

image

image

Environment:

  • OS: macOS Ventura 13.2.1
  • Package Version(s): On the project I was working on, the most recent package installed was observablecollection when the error started appearing.
  "dependencies": {
    "@quenty/attributeutils": "^8.11.1",
    "@quenty/badgeutils": "^6.7.0",
    "@quenty/basicpane": "^7.6.0",
    "@quenty/binder": "^8.8.0",
    "@quenty/blend": "^6.9.0",
    "@quenty/buttonhighlightmodel": "^7.12.0",
    "@quenty/characterutils": "^6.5.0",
    "@quenty/clienttranslator": "^8.11.0",
    "@quenty/cmdrservice": "^7.9.0",
    "@quenty/color3utils": "^5.10.0",
    "@quenty/datastore": "^7.23.0",
    "@quenty/gameproductservice": "^7.14.0",
    "@quenty/gameversionutils": "^3.2.0",
    "@quenty/genericscreenguiprovider": "^7.16.1",
    "@quenty/hide": "^5.26.0",
    "@quenty/httppromise": "^6.8.0",
    "@quenty/jsonutils": "^6.7.0",
    "@quenty/loader": "^6.1.0",
    "@quenty/observablecollection": "^5.23.0",
    "@quenty/playerbinder": "^8.8.0",
    "@quenty/servicebag": "^6.5.0",
    "@quenty/statestack": "^8.21.0",
    "@quenty/string": "^3.1.0",
    "@quenty/textserviceutils": "^7.13.0",
    "@quenty/timesyncservice": "^7.6.0",
    "@quenty/userserviceutils": "^3.9.0"
  },

Additional context
There aren't any errors until I try to require a module from the "bugged" package that gets synced in.

In the meantime, I can reliably work around this by downgrading the version of the package I installed - I just go to the changelog of the package I'm using and pick a downgraded version number, change the version number in my package.json and then rm -rf node_modules && npm i and the error seems to resolve in most cases.

This should be patched now, will keep open for a while more.