Row 21 in index.js in animalfarm/server should not have ? after q?
Should be
const q = req.query.q.toLowerCase() || '';
instead of
const q = req.query.q?.toLowerCase() || '';
Error received below when running node .
`file:///mnt/c/Users//Documents/SourceCodes/animalfarm/server/index.js:21
const q = req.query.q?.toLowerCase() || '';
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)`
It should work, there is nothing wrong in the const q = req.query.q?.toLowerCase() || ''; it would help if you share the entire code.
Maybe check the node version.
Row 21 in index.js in animalfarm/server should not have ? after q?
Should be
const q = req.query.q.toLowerCase() || '';
instead of
const q = req.query.q?.toLowerCase() || '';
Error received below when running/Documents/SourceCodes/animalfarm/server/index.js:21
const q = req.query.q?.toLowerCase() || '';
^
node .
`file:///mnt/c/Users/SyntaxError: Unexpected token '.' at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21)`
Code works after removing ?