如何在gatsbyJS中动态创建带有参数的页面?

I want a route like: /blog/:blogId/:slug

I tried this in my gatsby-node.js -

exports.onCreatePage = async ({ page, actions }) => {
  const { createPage } = actions

  createPage({
      path: "/blog/",
      matchPath: "/blog/:blogId/:slug",
      component: path.resolve("src/components/layouts/SingleBlogPageLayout.jsx"),
  })
}

It works perfectly in gatsby develop but showing issues in gatsby build

错误是:

failed Building static HTML for pages - 6.584s

 ERROR #95313 

Building static HTML failed for path "/"

See our docs page for more info on this error: https://gatsby.dev/debug-html


  247 | 
  248 | 
> 249 |       var store = didStoreComeFromProps ? props.store : contextValue.store;
      | ^
  250 |       var childPropsSelector = useMemo(function () {
  251 |         // The child props selector needs the store reference as an input.
  252 |         // Re-create this selector whenever the store changes.


  WebpackError: TypeError: Cannot read property 'store' of null

  - connectAdvanced.js:249 ConnectFunction
    node_modules/react-redux/es/components/connectAdvanced.js:249:1