react-universal-component: Unable to find x in Webpack chunks. Please check usage of Babel plugin.
After upgrading from 2.9.0 to 3.0.0 I get this error:
[FLUSH CHUNKS]: Unable to find Views-Home in Webpack chunks. Please check usage of Babel plugin.
Everything works correctly on the 2.9.0. You can check the code here: https://github.com/luangjokaj/react-ssr-boilerplate
All the dependencies are up to date except react-universal-component.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 33
in the RUC readme, you can also just turn off the / to - rename
ignoreBabelRename is by default set to false which allows the plugin to attempt and name the dynamically imported chunk (replacing / with -). In more advanced scenarios where more granular control is required over the webpack chunk name, you should set this to true in addition to providing a function to chunkName to control chunk naming.
Fixed it for some guys at Microsoft
ignoreBabelRename
solved the issues for me as well. Everything works perfectly as before. Thank you!@ScriptedAlchemy
ignoreBabelRename
did the trick, finally! 🎉I am having exactly the same issue. My CSS are also not correctly loaded initially, they get loaded later by client code.
Ill investigate this further
Hope this is helpful, I’ve been running into the same issue today and have been digging into it the past few hours:
Also, to note, I’m hitting this issue on 2.9.0 and 3.0.0.
Looking at the compiled code, it looks like yields the following transformation:
webpack-flush-chunks
throws that error here in flushChunks.js.This method is invoked shortly after here.
However, looking at the output of my stats.json,
assetsByChunkName
only contains the entry bundle.And then other chunks are listed under
assets
:Interestingly, the chunk name that is being looked up doesn’t even match the listed names in my
assets
object. Maybe something changed in how webpack outputsstats.toJson()
? (I’m on4.16.0
).