Rich-Harris/degit

[Bug] "UnhandledPromiseRejectionWarning"...

YogliB opened this issue · 2 comments

Environment info:
Degit v2.8.0
Node.js v10.x
Windows 10

Output after running degit in powershell:

(node:20120) UnhandledPromiseRejectionWarning: TypeError: sync(...).map(...).flat is not a function
    at main (C:\Users\yogib\scoop\persist\nvm\nodejs\v10.18.1\node_modules\degit\dist\bin.js:5551:5)
    at Object.<anonymous> (C:\Users\yogib\scoop\persist\nvm\nodejs\v10.18.1\node_modules\degit\dist\bin.js:5627:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\yogib\scoop\persist\nvm\nodejs\v10.18.1\node_modules\degit\bin.js:2:1)
(node:20120) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function 
without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20120) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I think it's a compatability issue with node@10, and can be solved by either changing the code, or starting to use babel for backwards compatibility.

I, personally think that it's okay if we only targeted node@lts and node@latest.

We definitely shouldn't mess around with Babel. Probably best to just rewrite it to not use .flat, I guess

same here. mark.

node: v10.15.3
degit: v2.8.0
macOS: 10.15.3

image