This might sound duplicate as there are similar questions available but None of them really helped me so I am opening a new one.
I get this error when I try to run my gatsby project on localhost:8000/
I tried everything that I found on Web (Changing my Export methods, using Curly brackets while import etc.) but nothing changed. The Error was same. I tried to re run the project also.
Here is my layout.js
import React, { useEffect } from 'react'
import Header from '../navigation/header'
import Footer from '../navigation/footer'
import * as layoutStyles from './layout.module.scss'
import { StylesProvider } from '@material-ui/core/styles';
import AOS from "aos";
import "aos/dist/aos.css";
const Layout = (props) => {
useEffect(() => {
AOS.init({
duration: 750,
offset: -20
});
}, []);
return (
<StylesProvider injectFirst>
<div>
<Header />
<div className={layoutStyles.container}>
{props.children}
</div>
<Footer />
</div>
</StylesProvider>
)
}
export default Layout
And I am importing it in Home.js Which is as follows:
import React from 'react'
import Layout from "../components/main/layout"
export default function Home() {
return (
<Layout>
<div>
<h1>Hello world!!</h1>
</div>
</Layout>
)
}
I don't where am I wrong? I changed eports methods to functional export and named export but it didn't worked.
