We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef80d57 commit fa274bbCopy full SHA for fa274bb
src/internals/webpack/build-webpack-client-watch.js
@@ -63,7 +63,7 @@ if (HAS_PRERENDERING) {
63
64
memoryFs.readFile(indexFileName, (readError, file) => {
65
if (readError) {
66
- fs.unlink(file);
+ fs.unlink(indexFileName);
67
} else {
68
fs.writeFile(indexFileName, file, writeError => {
69
if (writeError) {
@@ -87,8 +87,12 @@ if (HAS_PRERENDERING) {
87
88
// send index.html for all not found routes.
89
app.use((req, res) => {
90
- const readStream = wdmInstance.fileSystem.createReadStream(indexFileName);
91
- readStream.pipe(res);
+ try {
+ const readStream = wdmInstance.fileSystem.createReadStream(indexFileName);
92
+ readStream.pipe(res);
93
+ } catch (e) {
94
+ res.end('Application failed to build');
95
+ }
96
});
97
}
98
0 commit comments