gatsby开发因SyntaxError而失败



我正在尝试构建gatsby-starter shopify。我用这个自述创建了一个shopify商店应用程序。当我运行gatsby develop时,我会遇到以下错误:

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! gatsby-starter-shopify@1.0.0 develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gatsby-starter-shopify@1.0.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我在网上找不到类似的问题。如有任何帮助或指示,我们将不胜感激。

正如问题所指出的,正则表达式中存在语法错误。

更改:

/products(.+)/

收件人:

/products(.+)/

问题的出现是因为您正在转义第一个括号(((,因此第二个括号不匹配。

相关内容

最新更新