Skip to content

Server Side Rendering window is not defined. #82

@qk0106

Description

@qk0106

There are only some options left for us:

  • Give up SSR (We want to keep it).
  • Use pure apollo client and regex match localStorage to get the token, which is stored by aws-amplify and cognito authentication (This is risky).
  • Mock an incomplete window in advance. (Well, incomplete..)

We don't want to do things that would risk too much. Could you please do something about it?

`ReferenceError: window is not defined

ReferenceError: window is not defined

at Object.<anonymous> (/Users/.../node_modules/paho-client/src/mqttws31.js:2143:4)

at Module._compile (module.js:660:30)

at Module._extensions..js (module.js:671:10)

at Object.require.extensions.(anonymous function) [as .js] (/Users/.../node_modules/babel-register/lib/node.js:152:7)

at Module.load (module.js:573:32)

at tryModuleLoad (module.js:513:12)

at Function.Module._load (module.js:505:3)

at Module.require (module.js:604:17)

at require (internal/module.js:11:18)

at Object.<anonymous> (/Users/.../node_modules/aws-appsync/lib/link/subscription-handshake-link.js:30:12)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementUsed for enhancements to AppSync SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions