Closed tareefdev closed 5 years ago
Hey, you are totally right. One way to fix this is to add early return in onCreatePage
handler:
exports.onCreatePage = ({ page, actions }) => {
const { createPage, deletePage } = actions
+
+ if (page.context.locale) {
+ // if locale is already set, don't try to recreate pages again
+ return
+ }
// First delete the incoming page that was automatically created by Gatsby
// So everything in src/pages/
deletePage(page)
/cc @LekoArts
Description
After cloning this example repo, I tried to add an mdx page to the
src/page
, but whenever trying to build or develop the site, gatsby seems to stuck atsource and transform nodes
.I added
console.log(localizedPath);
at this line I noticed that gatsby stuck in a loop:pop, is the name of the mdx file.
Steps to reproduce
Expected result
pop
page in multi languages.Environment