alexandercerutti / passkit-generator

The easiest way to generate custom Apple Wallet passes in Node.js
MIT License
829 stars 104 forks source link

UnhandledPromiseRejectionWarning: TypeError: modelRecords.flat is not a function #188

Closed hernancasillas closed 7 months ago

hernancasillas commented 8 months ago

Running OS

CentOS 8

Running Node Version

10.24.0

Description

I'm running passkit-generator latest version.

I used this library on mac on local and worked perfectly, I love it. But when I try to generate a pass now on my CentOS server, it gets me this when I request the pass.

(node:2762505) UnhandledPromiseRejectionWarning: TypeError: modelRecords.flat is not a function at getModelFolderContents (/root/pass/node_modules/passkit-generator/lib/get ModelFolderContents.js:23:48) (node:2762505) UnhandledPromiseRejectionWarning: Unhandled promise rejection. Th is error originated either by throwing inside of an async function without a cat ch block, or by rejecting a promise which was not handled with .catch(). (reject ion id: 1) (node:2762505) [DEP0018] DeprecationWarning: Unhandled promise rejections are de precated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior

It generates the pass on my mac with Node version 16.16.0

Thanks in advance for the help.

alexandercerutti commented 8 months ago

Hi @hernancasillas, thanks for using passkit-generator!

Minimum required version to use passkit-generator is Node 14. All of 10, 14 and 16 are actually out of LTS Maintenance period, so please do expect things to progressively not work anymore with your codebase and fit with you needs. My suggestion is to upgrade NodeJs as soon as possible, also for a matter of security and bug fixes.