question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Added [app.serveOrigin] UnhandledPromiseRejectionWarning

See original GitHub issue

_Originally posted by @pavelfeldman in https://github.com/GoogleChromeLabs/carlo/issues/45#issuecomment-436094420_ _Commit: https://github.com/GoogleChromeLabs/carlo/commit/e384301633c59061bac6aa6959e4566b4e45c598_

App.serveOrigin(origin) doesn’t seem to work properly.

(node:2452) UnhandledPromiseRejectionWarning: TypeError: app.serveOrigin is not a function
    at carlo.launch.then (D:\Dokumenty\carlo-serve-origin-test\index.js:5:7)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:2452) 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: 2)
(node:2452) [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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pavelfeldmancommented, Nov 7, 2018

The idea behind serveOrigin is that it is used for dev mode and overrides serveFolder. Carlo should not be used without serveFolder, because it defeats Carlo’s purpose. You can run express and point your browser to the port if all you want is serve.

0reactions
dacturnecommented, Nov 7, 2018

Perhaps it could be changed in load() ?

load(uri = '') {
  if (!this.www_.size) {
    if (this.wwwOrigin_) {
      this.www_.set('/');
    } else {
      this.page_.close();
      throw new Error('Please call app.serveFolder(__dirname) or point to ' +
                      'other folder(s) with your web files');
    }
  }
  return this.page_.goto(`https://domain/${uri}`, {timeout: 0});
}

And it’d be implicitly set, saving from confusion as mentioned above

app.serveOrigin('https://example.org');
// app.serveFolder('/');
await app.load(); // no URI passed
Read more comments on GitHub >

github_iconTop Results From Across the Web

UnhandledPromiseRejectionWar...
js/MEAN stack and I'm following an Express tutorial. I get the following error: (node:11524) UnhandledPromiseRejectionWarning: Unhandled promise ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found