Skip to content

Conversation

@lifeeric
Copy link

I'm using react-css-burger in my project, but I get the following error when run gatsby build. gatsby runs on Node when creating production and node don't know document.
I fixed this on my local project, but please Accept this 'cause I can't deploy my project anywhere!

failed Building static HTML for pages - 3.524s
7:33:26 AM: error "document" is not available during server side rendering.
7:33:26 AM: 
7:33:26 AM:   34 | 
7:33:26 AM:   35 | var Burger = function Burger(props) {
7:33:26 AM: > 36 |   var root = document.documentElement;
7:33:26 AM:      | ^
7:33:26 AM:   37 |   var active = props.active,
7:33:26 AM:   38 |       onClick = props.onClick,
7:33:26 AM:   39 |       burger = props.burger,
7:33:26 AM: 
7:33:26 AM:   WebpackError: ReferenceError: document is not defined
7:33:26 AM:   
7:33:26 AM:   - index.es.js:36 
7:33:26 AM:     node_modules/react-css-burger/dist/index.es.js:36:1
7:33:26 AM:   
7:33:26 AM: 
7:33:26 AM: not finished Generating image thumbnails - 28.441s

lifeeric and others added 13 commits July 12, 2020 07:42
I'm using `react-css-burger` in my project, but I get the following error when run `gatsby build`. gatsby runs on Node when creating production and node don't know document.
I fixed this on my local project, but please Accept this 'cause I can't deploy my project anywhere! 

```
failed Building static HTML for pages - 3.524s
7:33:26 AM: error "document" is not available during server side rendering.
7:33:26 AM: 
7:33:26 AM:   34 | 
7:33:26 AM:   35 | var Burger = function Burger(props) {
7:33:26 AM: > 36 |   var root = document.documentElement;
7:33:26 AM:      | ^
7:33:26 AM:   37 |   var active = props.active,
7:33:26 AM:   38 |       onClick = props.onClick,
7:33:26 AM:   39 |       burger = props.burger,
7:33:26 AM: 
7:33:26 AM:   WebpackError: ReferenceError: document is not defined
7:33:26 AM:   
7:33:26 AM:   - index.es.js:36 
7:33:26 AM:     node_modules/react-css-burger/dist/index.es.js:36:1
7:33:26 AM:   
7:33:26 AM: 
7:33:26 AM: not finished Generating image thumbnails - 28.441s
```
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.0 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.4.0...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
…andlebars-4.7.6

Bump handlebars from 4.0.11 to 4.7.6 in /example
…ebsocket-extensions-0.1.4

Bump websocket-extensions from 0.1.3 to 0.1.4 in /example
…lliptic-6.5.3

Bump elliptic from 6.4.0 to 6.5.3 in /example
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

Successfully merging this pull request may close these issues.

1 participant