Errata

Learning Node

Errata for Learning Node

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
ePub Example 3-6 in the book; example3-3.js in the downloads

This issue exists in both node v4.2.6 on ubuntu, and node v4.4.6 on windows, with async version 2.0.0-rc.6. Book code and example download are equivalent. Both give the same error:

../learning_node/node_modules/async/dist/async.js:837
if (fn === null) throw new Error("Callback was already called.");
^

Error: Callback was already called.
at ../learning_node/node_modules/async/dist/async.js:837:36
at ../learning_node/example3-3.js:18:10
at Array.forEach (native)
at loopFiles (../learning_node/example3-3.js:17:13)
at nextTask (../learning_node/node_modules/async/dist/async.js:6627:18)
at ../learning_node/node_modules/async/dist/async.js:6621:17
at ../learning_node/node_modules/async/dist/async.js:339:31
at ../learning_node/node_modules/async/dist/async.js:840:20
at ../learning_node/example3-3.js:13:10
at FSReqWrap.oncomplete (fs.js:82:15)

Anonymous  Jun 26, 2016 
Printed Page 83
Code example at bottom of page

The call of callback in doSomething is missing null as its first argument. Without the required null error any caller would consider every call as returning an error.

Michael Soulier  Nov 08, 2015 
PDF Page 88
Middle of the page - Listing 4.2 Handling Multiple Request Types

OS is Win8.1 64 bit. Execute code from "Listing 4.2: Handling Multiple Request Type" (ie. the file "05_multiple_requests.js"). in the DOS Command (call this server). Brought up another DOS command and issued "curl -X GET http://localhost:8080" (call this client). The client command DOS printed out "{"error":"invalid_resource","message":"the requested resource does not exist."}"
The server DOS command print out "INCOMING REQUEST: GET /"

What could be the problem? How to overcome this error?

Anonymous  Sep 01, 2016