Open afrankel-sfdo opened 3 years ago
Figured out the problem with Apollo, needed to use renderToStringWithData
in index.node.js
Routing was a little tricker to pinpoint, the fix required altering nodeExternals...
nodeExternals({
whitelist: [
/babel-plugin-universal-import|react-universal-component/
]
}),
Looking into one remaining quirk where the route content quickly reverts to loading state and repaints.
Describe the bug
Unsure if this is a bug, improper approach, or incorrect expectations.
Server rendering for dynamic route imports and data fetching shows only initial loading state, and not the final information.
Environment
Expected behavior
Actual behavior
Reproducible demo
Routing
git clone https://github.com/afrankel-sfdo/cra-ssr-test.git cura-render-route; cd cura-render-route; git reset --hard edf948f1a4f1ede3bdeed030d6ae186a1d6b4955; yarn; yarn start
Data fetching
git clone https://github.com/afrankel-sfdo/cra-ssr-test.git cura-render-data; cd cura-render-data; git reset --hard f7d9fbd3659146f337da8bd7c31efbd86727d489; yarn; yarn start