marklagendijk/node-toogoodtogo-watcher

v3.10.2 and later: TypeError: Expected value which is `predicate returns truthy for any value`, received values of types `undefined`.

Closed this issue · 4 comments

First of all, thanks for the Datadome fixes.

When creating a docker container using v3.10.2 and later, the following error occurs on startup and the container stops:

file:///home/node/app/node_modules/@sindresorhus/is/dist/index.js:305
throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`);
^

TypeError: Expected value which is `predicate returns truthy for any value`, received values of types `undefined`.
at assertType (file:///home/node/app/node_modules/@sindresorhus/is/dist/index.js:305:15)
at Object.any (file:///home/node/app/node_modules/@sindresorhus/is/dist/index.js:406:36)
at set prefixUrl [as prefixUrl] (file:///home/node/app/node_modules/got/dist/source/core/options.js:582:16)
at Options.merge (file:///home/node/app/node_modules/got/dist/source/core/options.js:411:27)
at got.extend (file:///home/node/app/node_modules/got/dist/source/create.js:82:25)
at file:///home/node/app/lib/gotify.js:4:17
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.14.2

I am mapping the config directory containing a valid config.json, otherwise I'm having default settings for the container. As soon as I downgrade back to 3.10.0 the container starts up no issue and watching is resumed.

Looked a little further and the main exception is referenced in this issue of got:

sindresorhus/got#1257

The version of got was updated from ^11.8.2 to ^12.5.3 in 556dea1. Could this be the cause?

Yes, that is related.
The stacktrace says the issue is with the gotify notifications.

Maybe your configured gotify.url or gotify.apptoken has an issue?

const api = got.extend({
  prefixUrl: config.get("notifications.gotify.url"),
});

Thanks for the info - I don't have gotify configured though. As in, I don't have the gotify block in the config.json. Is the empty configuration block needed for the application to run?

Added the configuration blocks from the default config json and filled in relevant information, left everything else disabled. Application now runs.