Deploy fails due to Invalid regular expression SyntaxError
The deployment fails with the following error: SyntaxError: Invalid regular expression: /[(?.*?)]/: Invalid group
The output of the process is:
Automatically optimizing pages
Page Size Files Packages ┌ λ / 1.1 kB 17 77 ├ /_app 26.1 kB 0 85 ├ /_document ├ /_error 1.96 kB 0 65 └ λ /[lang]/[flow]/[countries]/[product] 316 kB 36 78
λ (Lambda) page was emitted as a lambda (i.e. getInitialProps) ⚡ (Static File) page was prerendered as static HTML
error:
SyntaxError: Invalid regular expression: /[(?.*?)]/: Invalid group
at module.exports.dynamicRoute (/Users/cristiamdasilva/.serverless/components/registry/npm/[email protected]/node_modules/serverless-next.js/lib/expressifyDynamicRoute.js:3:23)
at Object.keys.forEach.r (/Users/cristiamdasilva/.serverless/components/registry/npm/[email protected]/node_modules/serverless-next.js/serverless.js:65:43)
at Array.forEach (
35s › enantioHosting › SyntaxError: Invalid regular expression: /[(?.*?)]/: Invalid group
Which version of node do you have? You'll need >=10.11.0
Thank you very much for the quick response @danielcondemarin Now I updated the node version to 10.11.0 and after removing the directories 'node_modules', '.next', '.serverless', '.serverless_nextjs', installing and building everything again, the deploy finished ok.
Awesome, thank you very much again.