-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async chunks are not updated on the server #230
Comments
Deleting changed chunks from {
apply(compiler) {
compiler.hooks.afterEmit.tapAsync("webpack-invalidate-require", (stats, cb) => {
const updatedFiles = stats.chunks
.filter(v => v.rendered)
.reduce((acc, v) => acc.concat(v.files), []);
updatedFiles.forEach(v => {
const fullpath = path.resolve(stats.compiler.outputPath, v);
if (require.cache[fullpath]) {
delete require.cache[fullpath];
}
})
cb();
});
}
} |
Hello @Vladislao, actually there is a bug yes, splitted chunks are not flushed form cache. We have to fix it. The The best workaround is to clean all splitted chunks (we know them thanks to stats) in the If someone want to fix it, he is welcome! |
🐛 Bug Report
Hi! Thanks for such a great tool!
Changes made to async modules after the first render are not reflected in the subsequently rendered html. It looks like async chunks are cached and won't get re-required after initial require on the server.
To Reproduce
cd ./examples/server-side-rendering
ignore
in nodemon.json fromclient
tosrc/client
to make sure that server will not get restarted on every changeyarn dev
You will see something like
Server renders outdated html.
Expected behavior
Server renders html that is up-to-date.
Link to repo
https://github.com/smooth-code/loadable-components/tree/master/examples/server-side-rendering
envinfo
The text was updated successfully, but these errors were encountered: