This repository has been archived by the owner on Jan 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Client-side error when using code splitting in webpack #128
Comments
@pklicnik is the change needed on the server or client side of react-engine? |
pklicnik
pushed a commit
to pklicnik/react-engine
that referenced
this issue
Jan 20, 2016
pklicnik
pushed a commit
to pklicnik/react-engine
that referenced
this issue
Jan 20, 2016
commit 650f3d2 Author: Paul Klicnik <[email protected]> Date: Wed Jan 20 11:35:36 2016 -0500 paypal#128: Client-side error when using code splitting in webpack
+1 |
samsel
added a commit
that referenced
this issue
Jan 26, 2016
PR for #128: Client-side error when using code splitting in webpack
merged & published v3.1.0 with the change! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Our routes file is configured to use
require.ensure
so we can code-split our page into separate chunks using webpack. Eg:Server-side rendering succeeds without error, but an error appears in the console when mounted on the client:
After debugging through the issue, this seems to be a problem/bug/limitation in react-router.
As a work around, you need to wrap the call to
render
insidematch
to pre-load the routes configuration on the client. Snippet of the change needed on the react-engine sideSolution is discussed here:
remix-run/react-router#2036 (comment)
Example provided here:
https://github.com/rackt/example-react-router-server-rendering-lazy-routes
The text was updated successfully, but these errors were encountered: