Skip to content

Commit 43c4116

Browse files
authored
fix: Provide a more meaningful error when whitelist entry is missing
In warp-drive-data/warp-drive#8101 it was noted that the error message provided here did not give enough context for users to understand the issue was due to the Fastboot environment and the existence of the fastbootDependencies allow list. This should help greatly with that. Ref: warp-drive-data/warp-drive#8101 (comment)
1 parent 703e788 commit 43c4116

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/fastboot/src/fastboot-schema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ function buildWhitelistedRequire(whitelist, distPath, isLegacyWhitelist) {
189189
}
190190
} else {
191191
throw new Error(
192-
"Unable to require module '" + moduleName + "' because it was not in the whitelist."
192+
"Unable to require module '" + moduleName + "' in Fastboot because it was not explicitly allowed in 'fastbootDependencies' in your package.json."
193193
);
194194
}
195195
}
196196

197197
throw new Error(
198198
"Unable to require module '" +
199199
moduleName +
200-
"' because its package '" +
200+
"' in Fastboot because its package '" +
201201
packageName +
202-
"' was not in the whitelist."
202+
"' was not explicitly allowed in 'fastbootDependencies' in your package.json."
203203
);
204204
};
205205
}

0 commit comments

Comments
 (0)