From 43c4116f6b4610bf5512bc3e01616dea8613865e Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Wed, 7 Dec 2022 15:07:21 -0800 Subject: [PATCH 1/2] fix: Provide a more meaningful error when whitelist entry is missing In emberjs/data#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: https://github.com/emberjs/data/issues/8101#issuecomment-1341675294 --- packages/fastboot/src/fastboot-schema.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fastboot/src/fastboot-schema.js b/packages/fastboot/src/fastboot-schema.js index 91fcede9c..09a953c68 100644 --- a/packages/fastboot/src/fastboot-schema.js +++ b/packages/fastboot/src/fastboot-schema.js @@ -189,7 +189,7 @@ function buildWhitelistedRequire(whitelist, distPath, isLegacyWhitelist) { } } else { throw new Error( - "Unable to require module '" + moduleName + "' because it was not in the whitelist." + "Unable to require module '" + moduleName + "' in Fastboot because it was not explicitly allowed in 'fastbootDependencies' in your package.json." ); } } @@ -197,9 +197,9 @@ function buildWhitelistedRequire(whitelist, distPath, isLegacyWhitelist) { throw new Error( "Unable to require module '" + moduleName + - "' because its package '" + + "' in Fastboot because its package '" + packageName + - "' was not in the whitelist." + "' was not explicitly allowed in 'fastbootDependencies' in your package.json." ); }; } From 4ddd499e580925e98fd81ee425f66b5ab51c83dc Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 12 Dec 2022 15:16:17 -0500 Subject: [PATCH 2/2] run prettier --- packages/fastboot/src/fastboot-schema.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/fastboot/src/fastboot-schema.js b/packages/fastboot/src/fastboot-schema.js index 09a953c68..d08c7b747 100644 --- a/packages/fastboot/src/fastboot-schema.js +++ b/packages/fastboot/src/fastboot-schema.js @@ -189,7 +189,9 @@ function buildWhitelistedRequire(whitelist, distPath, isLegacyWhitelist) { } } else { throw new Error( - "Unable to require module '" + moduleName + "' in Fastboot because it was not explicitly allowed in 'fastbootDependencies' in your package.json." + "Unable to require module '" + + moduleName + + "' in Fastboot because it was not explicitly allowed in 'fastbootDependencies' in your package.json." ); } }