Skip to content

Commit 3549c91

Browse files
authored
Add an error message to nullthrows (#9733)
1 parent c3505e5 commit 3549c91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/core/src/requests/WriteBundlesRequest.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ async function run({input, api, farm, options}) {
6767
if (bundle.isPlaceholder) {
6868
let hash = bundle.id.slice(-8);
6969
hashRefToNameHash.set(bundle.hashReference, hash);
70-
let name = nullthrows(bundle.name).replace(bundle.hashReference, hash);
70+
let name = nullthrows(
71+
bundle.name,
72+
`Expected ${bundle.type} bundle to have a name`,
73+
).replace(bundle.hashReference, hash);
7174
res.set(bundle.id, {
7275
filePath: joinProjectPath(bundle.target.distDir, name),
7376
type: bundle.type, // FIXME: this is wrong if the packager changes the type...

0 commit comments

Comments
 (0)