Skip to content

Commit bd80b78

Browse files
arunodatimneutkens
authored andcommitted
Handle undefined assets when combining. (vercel#1569)
It's possible for common.js to be empty in certain cases. So, we need to handle it.
1 parent 4a069e9 commit bd80b78

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/build/plugins/combine-assets-plugin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export default class CombineAssetsPlugin {
1111
compiler.plugin('after-compile', (compilation, callback) => {
1212
let newSource = ''
1313
this.input.forEach((name) => {
14-
newSource += `${compilation.assets[name].source()}\n`
14+
const asset = compilation.assets[name]
15+
if (!asset) return
16+
17+
newSource += `${asset.source()}\n`
1518
delete compilation.assets[name]
1619
})
1720

0 commit comments

Comments
 (0)