Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Path must be a string. Received undefined #3

Open
alexblack opened this issue Jan 22, 2018 · 2 comments · May be fixed by #5
Open

TypeError: Path must be a string. Received undefined #3

alexblack opened this issue Jan 22, 2018 · 2 comments · May be fixed by #5

Comments

@alexblack
Copy link

alexblack commented Jan 22, 2018

Hi, I'm having trouble using --watch, I'm running this:

npm run watch

with

"watch": "copy-and-watch ./src/public/**/*.{html,css} ./build --watch"

and getting this result when I make a change to src/public/panel.html and save:

> [email protected] watch /Users/alex/dev/is/r2
> copy-and-watch ./src/public/**/*.{html,css} ./build --watch

[COPY] ./src/public/panel.html to build/panel.html
[COPY] ./src/public/panel.css to build/panel.css
[WATCH] ./src/public/**/*.html
[WATCH] ./src/public/**/*.css
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.relative (path.js:1268:5)
    at findTarget (/Users/alex/dev/is/r2/node_modules/copy-and-watch/index.js:37:33)
    at FSWatcher.copy (/Users/alex/dev/is/r2/node_modules/copy-and-watch/index.js:57:14)
    at emitOne (events.js:115:13)
    at FSWatcher.emit (events.js:210:7)
    at FSWatcher.<anonymous> (/Users/alex/dev/is/r2/node_modules/chokidar/index.js:196:15)
    at FSWatcher._emit (/Users/alex/dev/is/r2/node_modules/chokidar/index.js:238:5)
    at FSWatcher.<anonymous> (/Users/alex/dev/is/r2/node_modules/chokidar/lib/fsevents-handler.js:204:14)
    at addOrChange (/Users/alex/dev/is/r2/node_modules/chokidar/lib/fsevents-handler.js:210:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch: `copy-and-watch ./src/public/**/*.{html,css} ./build --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alex/.npm/_logs/2018-01-22T04_06_25_666Z-debug.log
@alexblack
Copy link
Author

Ah, changing it to this resolved the issue:

"watch": "copy-and-watch src/public/**/*.{html,css} build --watch"

@OldStarchy
Copy link

I'm also getting this error with the command copy-and-watch src/html/* dist --watch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants