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

Isomorphic apps #6

Open
jmatsushita opened this issue Oct 31, 2016 · 1 comment
Open

Isomorphic apps #6

jmatsushita opened this issue Oct 31, 2016 · 1 comment

Comments

@jmatsushita
Copy link

Hi there,

Thanks for the nice module. I've promoted it on SO

Any thoughts on how to make it easier to use it in an isomorphic app context? On the server side I get:

***/node_modules/graphql-docs/dist/webpack:/~/style-loader/addStyles.js:31
 	if (typeof options.singleton === "undefined") options.singleton = isOldIE();
 ^
 ReferenceError: window is not defined

Maybe related to #4 ?

Cheers,

Jun

@jmatsushita
Copy link
Author

FYI I've worked around this problem in the following way:

  if (typeof window != "undefined") {
    const GraphQLDocs = require('graphql-docs').GraphQLDocs;
    return <GraphQLDocs fetcher={fetcher} />
  } else {
    return <div></div>
  }

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

1 participant