monorepo icon indicating copy to clipboard operation
monorepo copied to clipboard

Apps throw different error messages for the same error

Open jannesblobel opened this issue 1 year ago • 1 comments

Problem

I created a new project with an invalid settings.json and 3 different error messages appear in three different apps.

All errors have the same cause/occur for the same reason.

The settings.json includes a command like in the example below.

Error messages

  1. Fink Error: TypeError: Cannot read properties of undefined (reading 'languageTags')

  2. IDE Extention/Kebab Error: Failed to load project "_userpath_/project.inlang": TypeError: Invalid host defined options

  3. CLI Error: The settings file at "_userpath_/project.inlang/settings.json" is not a valid JSON file: SyntaxError: Unexpected token / in JSON at position 4


Example JSON


{
// official schema ensures that your project file is valid
"$schema": "https://inlang.com/schema/project-settings",
// the "source" language tag that is used in your project
"sourceLanguageTag": "en",
// all the language tags you want to support in your project
"languageTags": ["en", "de"],
"modules": [
	"https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@4/dist/index.js"], 
// or use another storage module: https://inlang.com/c/plugins (i18next, json, inlang message format)
"plugin.inlang.i18next":{
    "pathPattern":"./resources/{languageTag}.json" }
}

Expected behavior

All apps should show the same error message. Otherwise, it is hard to debug this error.

Reproduction

  1. Open this Repo in Fink to see the first error
  2. Fork this repo
  3. Open this repo in Vs Code
  4. Try to load the repo in the Kebab/IDE extension ( see the second error)
  5. try to validate this repo with the CLI command .

Other information

Maybe this helps https://www.loom.com/share/f5d1a9f39fbd408f98d4f9ea41c4a55a

If you comment on Loom, please let me know, otherwise I won't notice.

jannesblobel avatar Feb 14 '24 15:02 jannesblobel

The SDK does not seem to validate settings. json when the project_id is missing. Because if you use this repo where the project id is included and follow the reproduction steps above, all three apps will show the same error message.

jannesblobel avatar Feb 14 '24 19:02 jannesblobel