ssr-cra-v2.1 icon indicating copy to clipboard operation
ssr-cra-v2.1 copied to clipboard

Crashed..

Open vitthalr opened this issue 7 years ago • 3 comments

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. (/Users/xxxx/xxxx/ssr-cra-v2.1-master/server/routes/index.js:4:25) at Module._compile (module.js:570:32) [nodemon] app crashed - waiting for file changes before starting...

vitthalr avatar Oct 04 '17 13:10 vitthalr

@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 avatar Oct 06 '17 14:10 mbifulco

@mbifulco You were right, upgrading NPM worked! Any reason why service worker is not added? Here is the score with lighthouse: -

vitthalr avatar Oct 06 '17 17:10 vitthalr

Yes, as mbifulco tell, the problem is because node js doesn`t support await. After install node 8.8.1 all works fine! Thanks.

kholiavko-roman avatar Oct 30 '17 10:10 kholiavko-roman