Limenius / ReactRenderer

Client and Server-side React rendering from PHP
MIT License
238 stars 37 forks source link

External Server Error: Invalid or unexpected token #22

Closed wajaja closed 6 years ago

wajaja commented 6 years ago

Hi! I've configured the bundle to use an external server; when i try to refresh some page in the browser; i got this Invalid or unexpected token in eval() function while the code in the log is (function() { var reduxProps, context, storeGenerator, store reduxProps = []; context = { "serverSide":true, "location":"\/app_dev.php\/search\/", "scheme":"http", "port":80, "base":"\/app_dev.php","pathname":"\/search\/", "search":null }; storeGenerator = ReactOnRails.getStoreGenerator('opinionStore'); store = storeGenerator(reduxProps, context); ReactOnRails.setStore('opinionStore', store); var props = []; return ReactOnRails.serverRenderReactComponent({ name: 'mainNode', domNodeId: 'sfreact-reactRenderer5b82edaa320b79.31532393', props: props, trace: true, railsContext: { "serverSide":true, "location":"\/app_dev.php\/search\/", "scheme":"http", "port":80, "base":"\/app_dev.php", "pathname":"\/search\/", "search":null }, }); })()

nacmartin commented 6 years ago

It is difficult to know, depends on what is in the external server, this external renderer should work https://github.com/Limenius/ReactRenderer/blob/master/doc/external-renderer.js

wajaja commented 6 years ago

its work; thank you @nacmartin you saved me

nacmartin commented 6 years ago

Thanks for letting us know that it worked @wajaja :D