kev14762
kev14762

Reputation: 9

gatsby develop fails with SyntaxError

I am attempting to build gatsby-starter-shopify. I have created a shopify store app using this readme. When I run gatsby develop I am met with this error:

ERROR

Invalid regular expression: /products\(.+)/: Unmatched ')'



  SyntaxError: Invalid regular expression: /products\(.+)/: Unmatched ')'

  - String.match

  - get-collection-route-params.js:29
    [AIM]/[gatsby-plugin-page-creator]/get-collection-route-params.js:29:105

  - Array.forEach

  - get-collection-route-params.js:21 getCollectionRouteParams
    [AIM]/[gatsby-plugin-page-creator]/get-collection-route-params.js:21:20

  - gatsby-node.js:211 Object.createAPageFromNode
    [AIM]/[gatsby-plugin-page-creator]/gatsby-node.js:211:77

  - create-pages-from-collection-builder.js:94 createPagesFromCollectionBuilder
    [AIM]/[gatsby-plugin-page-creator]/create-pages-from-collection-builder.js:94:45

  - runMicrotasks

  - task_queues.js:95 processTicksAndRejections
    internal/process/task_queues.js:95:5


not finished createPagesStatefully - 0.209s

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I am unable to find similar issues on the web. Any help or direction would be appreciated.

Upvotes: 0

Views: 129

Answers (1)

Ferran Buireu
Ferran Buireu

Reputation: 29335

As the issue points out, you have a syntax error in your regular expression.

Change:

/products\(.+)/

To:

/products(.+)/

The issue rises up because you are escaping the first parenthesis (() hence the second one is unmatched.

Upvotes: 1

Related Questions