serverless-next.js icon indicating copy to clipboard operation
serverless-next.js copied to clipboard

Deploy fails due to Invalid regular expression SyntaxError

Open cristiam86 opened this issue 7 years ago • 2 comments

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 () at NextjsComponent.prepareBuildManifests (/Users/cristiamdasilva/.serverless/components/registry/npm/[email protected]/node_modules/serverless-next.js/serverless.js:63:32) at

35s › enantioHosting › SyntaxError: Invalid regular expression: /[(?.*?)]/: Invalid group

cristiam86 avatar Sep 24 '19 09:09 cristiam86

Which version of node do you have? You'll need >=10.11.0

danielcondemarin avatar Sep 24 '19 09:09 danielcondemarin

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.

cristiam86 avatar Sep 24 '19 10:09 cristiam86