Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix Gatsby.js build error 'window is not defined' ? #590

Open
pstakashi opened this issue Aug 4, 2020 · 1 comment
Open

How to fix Gatsby.js build error 'window is not defined' ? #590

pstakashi opened this issue Aug 4, 2020 · 1 comment

Comments

@pstakashi
Copy link

pstakashi commented Aug 4, 2020

I started with 'gatsby new' command building a gatsby site, and added a framer component to index.js just like:

import React from "react"
import { Link } from "gatsby"

import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"
import {Frame} from 'framer';

const IndexPage = () => (
  <Layout>
    <SEO title="Home" />
    <Frame>
      Test
    </Frame>
  </Layout>
)

export default IndexPage

After executed 'gatsby build', this error occured.

WebpackError: ReferenceError: window is not defined

I could not fix this by solutions in the official doc (https://www.gatsbyjs.org/docs/debugging-html-builds/).

Anyone can help?

@fredericrous
Copy link

fredericrous commented Mar 4, 2021

I'm getting the same issue on NextJS. I think that's because serverside rendering is activated. I personally don't want to deactivate ssr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants