monorepo
monorepo copied to clipboard
Apps throw different error messages for the same error
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
-
Fink Error:
TypeError: Cannot read properties of undefined (reading 'languageTags')
-
IDE Extention/Kebab Error:
Failed to load project "_userpath_/project.inlang": TypeError: Invalid host defined options
-
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
- Open this Repo in Fink to see the first error
- Fork this repo
- Open this repo in Vs Code
- Try to load the repo in the Kebab/IDE extension ( see the second error)
- 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.
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.