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

React server-side-rendering ReferenceError: document is not defined. #30

Open
fleyai opened this issue Dec 27, 2018 · 1 comment
Open

Comments

@fleyai
Copy link

fleyai commented Dec 27, 2018

Is there any ways to perform server-side-rendering (ssr)?

Cause now there is err

`
/node_modules/keratin-authn/dist/keratin-authn.js:167
document.addEventListener('visibilitychange', function () {
^

ReferenceError: document is not defined
at new SessionManager (node_modules/keratin-authn/dist/keratin-authn.js:167:9)
at Object. (node_modules/keratin-authn/dist/keratin-authn.js:322:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Module._compile (node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)

`

@cainlevy
Copy link
Member

cainlevy commented Jan 8, 2019

@fleyai I'm unsure what AuthN would be able to accomplish during SSR, since it would not have access to the session refresh token or localstorage. Any ideas?

carcinocron pushed a commit to carcinocron/authn-js that referenced this issue Sep 21, 2019
Stop crashing if someone wanted to import the library in an SSR enabled app. keratin#30
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