trys / sergey

A tiny lil' static site generator
https://sergey.trysmudford.com
MIT License
302 stars 39 forks source link

UnhandledPromiseRejection error when running sergey --watch concurrently with another script #62

Open joulev opened 3 years ago

joulev commented 3 years ago

I regularly use sass in my sites, so I usually run this to make sure my compiled CSS is up to date.

$ sass --style=compressed --quiet scss/styles.scss css/styles.css --watch

Now I also want to deploy my Sergey site to localhost, so

$ sergey --watch

However, although just editing HTML files is fine, as soon as I edit my SCSS, sergey throws an error,

$ sergey --watch
Compiled in 290ms
Sergey running on http://localhost:8080
Compiled in 371ms
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: 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(). The promise rejected with the reason "Couldn't create folder: ./public/path/to/a/random/folder/".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Am I missing something...? since running concurrent commands like this, I think, is quite common, but I haven't seen anyone reporting this problem here.

mas-4 commented 3 years ago

I've been regularly experiencing this as well, without running sass watch.

griffi-gh commented 2 years ago

Always happens when you add non-html/js/css files

mas-4 commented 2 years ago

Always happens when you add non-html/js/css files

Interesting, I assume that would be why its happening for me. I'm using markdown files.