Skip to content

Commit

Permalink
fix: temporary fix for gatsbyjs/gatsby#26520
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Jan 28, 2021
1 parent e4c22ec commit 5aa8768
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions apps/silverback-gatsby/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,17 @@ export const createPages: GatsbyNode['createPages'] = async ({
language: languages.find((it) => it.id === other.langcode)!,
})),
};
return actions.createPage({
path: translation.path,
component: require.resolve(`./src/components/article`),
context,
});

const path = translation.path;
const component = require.resolve(`./src/components/article`);

// TODO: remove once the stale page data issue is fixed.
// https://github.com/gatsbyjs/gatsby/issues/26520
// Temporary fix: Call createPage twice with different contexts. This
// helps Gatsby to refresh the page data.
actions.createPage({ path, component, context: 'fake context' });

return actions.createPage({ path, component, context });
}),
);
};

0 comments on commit 5aa8768

Please sign in to comment.