I've already made a great search on the internet and couldn't solve this problem.
I'm using Gasby to develop a static page and I'm facing this error:
WebpackError: ReferenceError: window is not defined
My clue is that, this has to do with bootsrap/Modal module i'm using. But i've cleaned all my index.js and still getting the error when i try to build it.
//index.js
import React from 'react'
const IndexPage = () => (
<div>
</div>
)
export default IndexPage
Does someone have an idea of how can I solve it? Thanks!
Ps: I've already tried to import the bootstrap module on componentDidMount, i've also tried to set the gatsby-node.js and I also tried to import the bootstrap module with loadable-components.
Edit1: Plugins portions from gatsby-config.js
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `ayo`,
short_name: `ayo`,
start_url: `/`,
background_color: `#fff`,
theme_color: `#20336C`,
display: `minimal-ui`,
icon: `src/images/icon.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],