-
Notifications
You must be signed in to change notification settings - Fork 6
clearTimeout is not defined #9
Comments
I'll take a look later. In the meantime, try a Another thing to try would be to define a dummy |
@nitely Thank you for such a quick response. Regarding the dummy
And then I started to get Additional info: It worked just fine - no errors. But when I modified
I got:
|
Yeah, that. That makes sense, windows is not defined, since that's a browser thing. Maybe you are calling some react function other than render to string. I've not tried a recent react versions, maybe render to string is no longer synchronous.
This issue is stated in the docs |
This is how you would define Take a look at this https://github.com/nitely/python-react-v8/blob/master/examples/simple/src/index.js example, all it does is call |
Unfortunately, I've got a lot of spots where Thank you for cooperation! |
Most window functions make no sense when rendering a static HTML (that what's you are realy doing when calling react.renderToString). There is no browser/window. Things like timeouts are of no use... You would want to render the view ASAP, not relaying on something that gets render after some timeout or after rendering the HTML, since at that point all you have is a string. I think mostof those functions should just be no-ops (ie. dummy functions that do nothing) but then you be hiding some weird bugs by doing that. Webpack is usually ran as a pre step to compile the JS, that should not be an issue, I use it. you can use node and webpack to compile the code, then use the bundle with this library. If you can control the code that call window functions, you can always do stuff like You could also try this
It should ignore all window function calls... FWIW, this is not a limitation of this library, but a known "issue", see:
The first link advises to define |
Hi @nitely I've got an issue here:
Do you have any thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: