cra-ssr
cra-ssr copied to clipboard
Window is not defined error from third party libraries
I have been running into this issue: Misbehaving libraries that are accessing the window object directly. I have been trying workarounds I have found online but CRA keeps throwing errors
Ok, I found a workaround that works:
const someMisbehavingLibrary = (isServer ? null : require('misbehaving-library').default);
Maybe this should be added to the ReadMe or tutorial. It took me a lot of time of trial and error to find the solution
Hey, my apologies for the long wait @jackpilowsky - I'm looking to ensure this is fixed with version 2.0. If you're interested, I could really use your thoughts for what you'd like to see in the upcoming version. Feel free to comment on the issue here with any suggestions. :)