zont / copy-and-watch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(node:43172) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE

RickR2H opened this issue · comments

I got an error with this command: "filecopy":"copy-and-watch --watch templates/files/media/**/*.{css,js} zzz/dist/"

[WATCH] templates/files/media/**/*.{css,js}
(node:43172) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at Object.relative (path.js:492:5)
at findTarget (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\index.js:40:33)
at FSWatcher.copy (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\index.js:60:14)
at FSWatcher.emit (events.js:400:28)
at FSWatcher.emitWithAll (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\node_modules\chokidar\index.js:540:8)
at FSWatcher._emit (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\node_modules\chokidar\index.js:632:8)
at listener (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\node_modules\chokidar\lib\nodefs-handler.js:370:20)
(Use node --trace-warnings ... to show where the warning was created)
(node:43172) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:43172) [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.

Hope you can fix this!

Thanks in advance!

same issue

Me as well.

Windows.

Node 14.17.3.

I had the same issue on 0.1.6, but I've tried a version from master and it works without the bug.

Sorry, that's false. I was using not the master version but this fork - "git@github.com:HoldYourWaffle2/copy-and-watch.git" (which originates from this PR #5) - it works but outdated