Skip to content

Commit

Permalink
fix: Provide a more meaningful error when whitelist entry is missing
Browse files Browse the repository at this point in the history
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: emberjs/data#8101 (comment)
  • Loading branch information
runspired committed Dec 7, 2022
1 parent 703e788 commit 43c4116
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/fastboot/src/fastboot-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,17 @@ 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."
);
}
}

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."
);
};
}
Expand Down

0 comments on commit 43c4116

Please sign in to comment.