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

Stopped working with SSR since 0.32 => 0.33 #25

Closed
crubier opened this issue May 23, 2020 · 3 comments
Closed

Stopped working with SSR since 0.32 => 0.33 #25

crubier opened this issue May 23, 2020 · 3 comments

Comments

@crubier
Copy link

crubier commented May 23, 2020

While all version of drei <= 0.32 work with Server Side Rendering, all verion >= 0.33 fail in Gatsby (and I supposed most Server Side Rendering solutions) with this error:

failed Building static HTML for pages - 10.964s

 ERROR #95312 

"document" is not available during server-side rendering.

See our docs page for more info on this error: https://gatsby.dev/debug-html


> 1 | import _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';
    | ^
  2 | import { createContext, forwardRef, createElement, Component, Fragment } from 'react';
  3 | import createCache from '@emotion/cache';
  4 | import { getRegisteredStyles, insertStyles } from '@emotion/utils';


  Error: WebpackError: ReferenceError: document is not defined
  
  - core.esm.js:1 
    [@emotion-core-npm-10.0.28-490246e9e8-2.zip]/[@emotion]/core/dist/core.esm.js:1:1

This seems to be related to the introduction of troika, I think troika uses document with no checks, failing on server side.

@drcmda
Copy link
Member

drcmda commented May 23, 2020

i believe this could be related to #23 there should not be a trace of troika in the bundle if you dont use it. otherwise i think we have to open a ticket on troikas GH.

@drcmda
Copy link
Member

drcmda commented May 24, 2020

Could you try his fix out protectwise/troika#46 ?

@gsimone
Copy link
Member

gsimone commented Aug 1, 2020

Closing since it's a bunch of versions ago. Please reopen if it's still an issue with the latest version 👍

@gsimone gsimone closed this as completed Aug 1, 2020
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

3 participants