react_on_rails
react_on_rails copied to clipboard
ENHANCEMENT: Extremely confusing if both server-bundle.js and hashed server-bundle.js are created
React on Rails will first use a hashed server-bundle that's listed in the manifest.
If that happens and split chunks is turned on, the error message when the server-bundle is loaded will show something like this:
https://stackoverflow.com/questions/56696118/window-is-not-defined-in-server-side-render-window-webpackjsonp
window["webpackJsonp"] ||
The root cause is accidentally using a bundle file that was created with the client setup to do chunking.
The fix is to make sure that the client bundle setup does not accidentally create another server-bundle when the server bundle setup should be doing that.
The code for server-rendering should throw an exception if both the hashed (in manifest) and non-hashed files are present.