Thibault Cap
Thibault Cap

Reputation: 21

Gatsby: import components into a mdx file that is outside the src folder

I am trying to make my portfolio on Gatsby but I have a little problem about this starter: https://github.com/LekoArts/gatsby-starter-portfolio-emma

I try to import some components in /content/pages/about/index.mdx

I tried to import the footer (to testing) with this code which returns: "Footer is not defined":

---
title: 'About'
slug: 'about'
cover: './mountains.jpg'
---

import Footer from '../../../src/components/Footer';

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands.

<Footer />

I cannot find the problem. Can someone guide me on how to approach this problem?

Upvotes: 2

Views: 925

Answers (1)

Mr Washington
Mr Washington

Reputation: 1413

I had the same issue yesterday. I solved it this way:

  1. Stop the server
  2. Clean gatsby cache with the following command
$ gatsby clean
  1. Restart the dev server.

Upvotes: 1

Related Questions