Closed dalyr95 closed 4 years ago
On the client, the modCache is always empty, which reminded me of this issue https://github.com/faceyspacey/react-universal-component/issues/17#issuecomment-316838874
as I was just dumping what flushChunks gave me onto the page and the Chunk JS was always last, so by reversing the order, it's stopped this issue as the modCache has the entry!
Now on prod, react router is complaining about (index):136 Error: Invariant failed: You should not use <withRouter(t) /> outside a <Router>
but not on dev 🙄
The SSR render is working fine, but when the CSR renders, it flashes the loading component. I've looked at the similar issues but can't find a solution.
I have a webpack setup which exports a server.js file which express consumes.
Webpack config
externals
is the filter as in the ReadMeLimitChunkCountPlugin
is set tomaxChunks: 1
App.jsx
It was
universal(import(xyz)
but looking at the other issues for this, functions was suggested as a solution to no avail. Also addedignoreBabelRename
as it wasn't finding the chunks beforeThe server is transpiled via Babel as well
.babelrc
package.json
Also tried
clearChunks()
as in the ReadMe and<ReportChunks report={chunkName => chunkNames.push(chunkName)}>
. Although I'm not sure I was using it correctly, is it just meant to be an empty array as perlet chunkNames = []
?Any help would be appriciated as I can't seem to solve it.