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

[Gatsby Build] window is not defined #10

Closed
QasimRRizvi opened this issue Feb 11, 2020 · 4 comments
Closed

[Gatsby Build] window is not defined #10

QasimRRizvi opened this issue Feb 11, 2020 · 4 comments

Comments

@QasimRRizvi
Copy link

I'm trying to build my website with gatsby build command but end up on this error

WebpackError: ReferenceError: window is not defined
  
  - react-bootstrap-carousel.js:1 Object../node_modules/react-bootstrap-carousel    /dist/react-bootstrap-carousel.js
    node_modules/react-bootstrap-carousel/dist/react-bootstrap-carousel.js:1:1
  
  - servicesSlider.js:1 Module../src/components/servicesSlider.js
    src/components/servicesSlider.js:1:1
  
  - index.js:1 Module../src/components/index.js
    src/components/index.js:1:1
  
  - 404.js:1 Module../src/pages/404.js
    src/pages/404.js:1:1

Any help would be great!

@skycloud1030
Copy link
Owner

skycloud1030 commented Feb 12, 2020

@QasimRRizvi

Add typeof check for window
Update to 4.0.3 e253b40

gatsbyjs/gatsby#309

@QasimRRizvi
Copy link
Author

image
Still getting same issue any other workaround for this

  
  - react-bootstrap-carousel.js:1 Object../node_modules/react-bootstrap-carousel/dist/react-bootstrap-carousel.js
    node_modules/react-bootstrap-carousel/dist/react-bootstrap-carousel.js:1:299
  
  - servicesStyles.js:1 Module../src/styles/servicesStyles.js
    src/styles/servicesStyles.js:1:1
  
  - servicesSlider.js:1 Module../src/components/servicesSlider.js
    src/components/servicesSlider.js:1:1
  
  - index.js:1 Module../src/components/index.js
    src/components/index.js:1:1
  
  - 404.js:1 Module../src/pages/404.js
    src/pages/404.js:1:1```

@skycloud1030 skycloud1030 reopened this Mar 3, 2020
@skycloud1030
Copy link
Owner

@QasimRRizvi
I will setup gatsby enviroment to test this bug

@skycloud1030
Copy link
Owner

@QasimRRizvi
This issue caused by webpack4: webpack/webpack#6525
This should be fixed in 4.0.6 e4fa5fd

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