After make a change and saving, on hot reload we see this error which runs for like 5 mins through every page it seems. It makes me think it has something to do with our / change to our routes. I've done some research on it, and haven't found anything definitive as to what the problem may be. But we've tried to do all the standard troubleshooting techniques, and it still persists
warn Non-deterministic routing danger: Attempting to create page:
"/jp/docs/using-new-relic/welcome-new-relic/get-started/glossary", but page
"/jp/docs/using-new-relic/welcome-new-relic/get-started/glossary/" already exists
This error will spit out in the terminal for about 5 mins
We reached out to Dustin at Gatsby and he pointed to this code
and said
There鈥檚 no guarantee that that鈥檚 deterministic and may differ. I bet if you log before that line that鈥檚 the code path that is triggered and is causing the difference.
Hi folks :) I solve this by console logging, e.g. something like:
console.log('\n==================================='n)
console.log(JSON.stringify(page, null, 2))
and I _predict_ (but I've been wrong before!) you'll see a different page path in the highlighted context. You likely just need to normalize in the same way when you create the page in the first place, albeit that is a touch strange.
In any scenario -- the warning is not a red herring, definitely on content update, the page is being re-created with a different (non-trailing) path, so that's the most likely spot!
@DSchau thanks for the pro tip here. We appreciate it!
@jerelmiller if you get bored again.... 馃グ
Most helpful comment
Hi folks :) I solve this by console logging, e.g. something like:
and I _predict_ (but I've been wrong before!) you'll see a different page path in the highlighted context. You likely just need to normalize in the same way when you create the page in the first place, albeit that is a touch strange.
In any scenario -- the warning is not a red herring, definitely on content update, the page is being re-created with a different (non-trailing) path, so that's the most likely spot!