Skip to content

Commit 5cd32b1

Browse files
emily-shenedmundhung
andauthoredMar 17, 2025··

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
 

‎.changeset/cute-pianos-joke.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
fix: throw explicit error for unknown mimetype during `wrangler check startup`

‎packages/wrangler/src/check/commands.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,15 @@ async function getEntryValue(
148148

149149
function getModuleType(entry: FormDataEntryValue) {
150150
if (entry instanceof Blob) {
151-
return ModuleTypeToRuleType[mimeTypeModuleType[entry.type]];
151+
const type = ModuleTypeToRuleType[mimeTypeModuleType[entry.type]];
152+
153+
if (!type) {
154+
throw new Error(
155+
`Unable to determine module type for ${entry.type} mime type`
156+
);
157+
}
158+
159+
return type;
152160
} else {
153161
return "Text";
154162
}

0 commit comments

Comments
 (0)
Please sign in to comment.