Errata

Web Development with Node and Express

Errata for Web Development with Node and Express

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
Mobi Page 1
code example

The SSL files meadowlark.crt and meadowlark.pem are not used anywhere in the software code delivered with the book, as described in the book content

Dorin Ionescu  Feb 24, 2021 
PDF Page 27
Code example, importing handlebar

const expressHandlebars = require('express-handlebars') is probably for Type Script. It causing error "expressHandlebars is not a function".

I had to change it to:
const { engine } = require("express-handlebars");

to make it work.

Anonymous  Feb 06, 2022 
PDF Page 48
Code example

One test is missing from the code:
expect(res.render.mock.calls.length).toBe(1)
It was quite confusing because the next page mentioned the test specifically.

Anonymous  Feb 07, 2022 
Printed Page 49
1st paragraph

The paragraph says first expect in preceding code block in page 48 checks that render was called only once. However there is no such expect in code block.
I think this line is missing -
expect(res.render.mock.calls.length).toBe(1)

In the subsequent tests in page 49 this line is present.

Amit Jha  Feb 07, 2021 
Printed Page 53
whole page

Is it just me or does the next not show how to run the Puppeter integration test?

Anonymous  Feb 01, 2021 
PDF Page 84
Code example for the layout.

The code is incorrect. It is the code for the section and not the layout. Looks like copy and paste error.

DaiJin  Feb 12, 2022 
PDF Page 105
code excerpt

Running the integration test throws an error on some systems (on my OSX and OpenSuse machines) and passed on others (on Elementary OS).

Error thrown: "Exceeded timeout of 5000 ms for a test."

Can be addressed by adding jest.setTimeout(newTimeout) to the integration test code with a higher value (20000 worked for me) or adding it as an argument of the test after the callback;

test('home page links to about page', async () => {}, 20000)

Anonymous  Jun 01, 2022 
PDF Page 106
Second half of the page

To delete a cookie, use req.clearCookie :

Should be;

To delete a cookie, use res.clearCookie :

DaiJin  Feb 14, 2022 
PDF Page 111
Code example

The regex doesn't seem to work. Even if it did, you would need to put ! in front of it in the following 'if' statement.

DaiJin  Feb 16, 2022 
PDF Page 134
Second code snippet

$ export NODE_ENV=production

Should have been:

$ set NODE_ENV=production

DaiJin  Mar 06, 2022 
PDF Page 142
The last code snippet

app.get('/epic-fail', (req, res) => {
process.nextTick(() =>
throw new Error('Kaboom!')
)
})

Should be:
app.get('/epic-fail', (req, res) => {
process.nextTick(() =>
{ throw new Error('Kaboom!')}
)
})

There should be {} around the throw statement.

Worawit Lalitkiattikool  Mar 06, 2022 
Mobi Page 5799
Kindle location 5799, second paragraph "The Process of ..."

In the paragraph
"The process of purchasing a certificate
....
You will then generate a certificate signing request (CSR)"

the command line for generating the CSR is missing (there is only a command to generate PEM and CRT on a previous page)
I know that we may find this online but we trust you and we want something that works
I bought this book because my SSL GoDaddy certificate do not work with my Node Express program
I tried a lot of online advice and then your bought your book and I went to chapter 18 where the command line was missing
What should I do now? Buy another book?

Dorin Ionescu  Feb 24, 2021