ssr-cra-v2.1
ssr-cra-v2.1 copied to clipboard
Crashed..
ssr-cra-v2.1-master/server/universal.js:26
async function serverRender(req, res, htmlData){
^^^^^^^^
SyntaxError: Unexpected token function
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.
@vitthalr It's possible you saw this error because you're running a version of node that doesn't support the async
keyword. Can you confirm what version of node you're running on? You can usually do this with node -v
. I'm not positive when async was added to the node engine, but I'm running this on v8.4.0
without issue.
@mbifulco You were right, upgrading NPM worked! Any reason why service worker is not added? Here is the score with lighthouse: -
Yes, as mbifulco tell, the problem is because node js doesn`t support await. After install node 8.8.1 all works fine! Thanks.