CMS Development

MateuszFryc
Member

hs watch throws UnhandledPromiseRejectionWarning: RangeError

SOLVE

I'm having trouble to run cli command: watch.

My projects structure looks as follows:

 

projectDir
   src (dir)
      website files
   hubspot.config.yml

 

I've tried to watch files by typing:

hs watch src /

 

but I'm getting the fallowing error:

(node:46314) UnhandledPromiseRejectionWarning: RangeError: path should be a `path.relative()`d string, but got "../../../../.."
    at throwError (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/ignore/index.js:337:9)
    at checkPath (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/ignore/index.js:356:12)
    at Ignore._test (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/ignore/index.js:473:5)
    at Ignore.ignores (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/ignore/index.js:512:17)
    at shouldIgnoreFile (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/@hubspot/cms-lib/ignoreRules.js:49:22)
    at ignored (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/@hubspot/cms-lib/lib/watch.js:101:22)
    at matchPatterns (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/anymatch/index.js:62:18)
    at FSWatcher._userIgnored (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/anymatch/index.js:94:14)
    at FSWatcher._isIgnored (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/chokidar/index.js:761:15)
    at FsEventsHandler._addToFsEvents (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/chokidar/lib/fsevents-handler.js:449:18)
(node:46314) 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:46314) [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.
/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/@hubspot/cms-lib/lib/walk.js:57
    return Promise.all(files.map(file => generateFilePromise(dir, file)));
                             ^

TypeError: Cannot read property 'map' of undefined
    at processFiles (/usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/@hubspot/cms-lib/lib/walk.js:57:30)
    at /usr/local/lib/node_modules/@hubspot/cms-cli/node_modules/@hubspot/cms-lib/lib/walk.js:64:7
    at FSReqCallback.oncomplete (fs.js:154:23)
0 Upvotes
1 Accepted solution
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

hs watch throws UnhandledPromiseRejectionWarning: RangeError

SOLVE

@MateuszFryc I believe it's because you need to upload your files in the design manager to a folder. Create a folder in the design manager at the root level called "groovy_files" then your watch command would be 

hs watch src groovy_files

 

Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

0 Upvotes
1 Reply 1
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

hs watch throws UnhandledPromiseRejectionWarning: RangeError

SOLVE

@MateuszFryc I believe it's because you need to upload your files in the design manager to a folder. Create a folder in the design manager at the root level called "groovy_files" then your watch command would be 

hs watch src groovy_files

 

Stefen Phelps, Community Champion, Kelp Web Developer
0 Upvotes