1

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.

ehrencrona
  • 6,102
  • 1
  • 18
  • 24
  • 1
    You need to supply more information to get a helpful answer: Are any of these functions from a dependency? What do they do? How is Node.js relevant for answering this question? – EliteRaceElephant Jul 09 '20 at 00:33
  • Does this answer your question? [You should not use outside a ](https://stackoverflow.com/questions/48640280/you-should-not-use-link-outside-a-router) – simmer Jul 09 '20 at 05:19
  • I am not sure what the error means, as I cannot see any or in the whole file. Thanks. – Charles Calzia Jul 09 '20 at 06:41

0 Answers0