I am working on converting a site from Nodejs app to Gatsby. I continue to be stuck on this error, which I receive when visiting certain pages (which are in the /src/pages/
folder):
Error: Invariant failed: You should not use <Link> outside a <Router>:
domReady(() => {
renderer(<Root />, rootElement, () => {
apiRunner(`onInitialClientRender`)
})
})
These lines above are found in the /.cache/app.js
file.
In the package.json file I have the following dependencies:
{
"gatsby": "^2.23.12",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"gh-pages": "^2.2.0",
"markdown-to-jsx": "^6.11.1",
"moment": "^2.24.0",
"node-sass": "^4.13.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-dotdotdot": "^1.3.1",
"react-helmet": "^6.0.0",
"react-masonry-css": "^1.0.14",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"react-slick": "^0.25.2",
"react-snap": "^1.23.0",
"turndown": "^6.0.0"
}
Any help would be much appreciated. Thank you.