Skip to content

It appears that the CreatePages function is not being called during the build step. With Ts #37612

Closed Answered by gh640
Hyuga-Tsukui asked this question in Help
Discussion options

You must be logged in to vote

The code looks fine.

I tried changing gatsby-node.js to gatsby-node.ts that uses createPages() to reproduce the problem but it works.

npx gatsby new gatsby-starter-default https://github.com/gatsbyjs/gatsby-starter-default
cd gatsby-starter-default
mv gatsby-node.js gatsby-node.ts

Edited gatsgy-node.ts as follows:

from

/**
 * Implement Gatsby's Node APIs in this file.
 *
 * See: https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/
 */

/**
 * @type {import('gatsby').GatsbyNode['createPages']}
 */
exports.createPages = async ({ actions }) => {
  const { createPage } = actions
  createPage({
    path: "/using-dsg",
    component: require.resolve("./src/templates/using-dsg.js"),

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Hyuga-Tsukui
Comment options

@gh640
Comment options

Answer selected by Hyuga-Tsukui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants