-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Closed
Copy link
Labels
async_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.
Description
- Node Version:
v8.2.1
- Platform:
Linux 4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- [email protected]
My product is not affected by this bug, but I report it anyway because it's still a bug and may affect someone else.
'use strict';
const fetch = require('node-fetch');
// Function name `fetch` clashes with required `fetch`!
const FooBar = async function fetch(url, encoding) {
const res = fetch(url); // Programmer forgot `await` here!
const text = await res.text();
};
(async function () {
return await FooBar('https://github.com');
})();
$ node foobar.js
Error: async hook stack has become corrupted (actual: 0, expected: 1)
1: node::Start(uv_loop_s*, int, char const* const*, int, char const* const*) [node]
2: node::Start(int, char**) [node]
3: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
4: 0x8ec861 [node]
Expected
User-friendly error message is expected, not this stack error.
refack and AndreasMadsen
Metadata
Metadata
Assignees
Labels
async_hooksIssues and PRs related to the async hooks subsystem.Issues and PRs related to the async hooks subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.