opral / inlang-message-sdk

0 stars 0 forks source link

Weak error message when module in project settings fails typecheck #44

Closed jldec closed 1 month ago

jldec commented 1 month ago

Context

E.g. The type declaration requires that modules URLs end in `.js`, but the error message when this is not the case, is unclear:

ProjectSettingsInvalidError: The project settings are invalid:

"/modules/0":

Expected all values to match
    at parseSettings (file:///Users/jldec/opral/monorepo/inlang/source-code/cli/dist/main.js:88702:13)
    at loadSettings (file:///Users/jldec/opral/monorepo/inlang/source-code/cli/dist/main.js:88695:10)

Proposal

Either improve the error, or remove the check if the error can't easily be improved
In this case, most bad urls will be caught by a module load error or another runtime error.

samuelstroschein commented 1 month ago

Proposal

  1. keep the validation because the inlang settings component etc use those static validations (cc @nils.jacobsen) BUT
  2. remove the throw/validation in the sdk. if one module is invalid, but three are valid, the project should still load