K
K
komigor2021-06-06 15:43:53
Node.js
komigor, 2021-06-06 15:43:53

Why does the library swear?

I call a function from the 'windows-iana' library

const timeZoneId = iana.findIana(user.timeZone);

and get this error

TypeError: WINDOWS_TO_IANA_MAP.filter(...).map(...).flat is not a function
    at Object.findIana (/home/ihor/Class-attender-bot/Class attender/node_modules/windows-iana/dist/windows-iana.cjs.development.js:3890:6)
    at /home/ihor/Class-attender-bot/Class attender/controllers/api/clendar.js:23:37
    at handleReturn (/home/ihor/Class-attender-bot/Class attender/node_modules/express-promise-router/lib/express-promise-router.js:24:23)
    at /home/ihor/Class-attender-bot/Class attender/node_modules/express-promise-router/lib/express-promise-router.js:64:7
    at handleReturn (/home/ihor/Class-attender-bot/Class attender/node_modules/express-promise-router/lib/express-promise-router.js:24:23)
    at /home/ihor/Class-attender-bot/Class attender/node_modules/express-promise-router/lib/express-promise-router.js:64:7
    at Layer.handle [as handle_request] (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/layer.js:95:5)
    at /home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/index.js:335:12)
    at next (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/index.js:174:3)
    at router (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/home/ihor/Class-attender-bot/Class attender/node_modules/express/lib/router/layer.js:95:5)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-06-06
@komigor

What version of Node.js? The method flathas appeared since version 11.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question