FredrikOseberg / react-chatbot-kit

MIT License
301 stars 141 forks source link

Is this library ssr compliant ? #22

Closed Tanmayp11 closed 3 years ago

Tanmayp11 commented 3 years ago

Can we compile application using this library and serve in via express application ?

Tanmayp11 commented 3 years ago

@FredrikOseberg ReferenceError: document is not defined at u (C:\Documents\reference\testreact\test_bot\node_modules\react-chatbot-kit\build\index.js:1:6198)

How to use this library with existing applications rendered server side ?

Using Express for ssr

FredrikOseberg commented 3 years ago

@FredrikOseberg ReferenceError: document is not defined at u (C:\Documents\reference\testreact\test_bot\node_modules\react-chatbot-kit\build\index.js:1:6198)

How to use this library with existing applications rendered server side ?

Using Express for ssr

Thanks. I'll look into it.

Tanmayp11 commented 3 years ago

I think by code splitting my project using webpack can resolve things, just figuring out how should I proceed.

FredrikOseberg commented 3 years ago

I think by code splitting my project using webpack can resolve things, just figuring out how should I proceed.

That could work. I'm looking into creating a build target for the server specifying node as the target. I'll let you know when I progress on this.

FredrikOseberg commented 3 years ago

@Tanmayp11 I built a new version: 1.1.2. It should take of this issue. I was successfully able to use the package using ReactDOM.hydrate and an express application. Thanks for bringing this to my attention.