i18n_compile Fails with TypeError: Cannot read properties of undefined (reading 'length') due to undefined message
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- build-system, localization
Research direction
Start with the npm run i18n_compile command and inspect src/i18n/messages, especially the locale files named in the warnings and the dropzone.Dropzone.invalidSizeLessError entry. Verify the translation data for that ID and rerun the compilation; done means the warnings and TypeError no longer occur.
Written by the indexing model from the issue text.
Description
Description
The npm run i18n_compile script, which uses formatjs compile-folder, is failing with a TypeError when attempting to compile the translation messages.
This appears to be caused by an undefined translation message for the ID "dropzone.Dropzone.invalidSizeLessError" across multiple language files. The @formatjs/cli tool is issuing a series of warning messages indicating the validation error before the final crash:
Branch: release-23.x
➜ paragon git:(742704416d) npm run i18n_compile
> @openedx/paragon@20.18.1 i18n_compile
> formatjs compile-folder --format transifex ./src/i18n/messages ./src/i18n/messages
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/es_AR.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/ar.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/fr.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/he.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/es_419.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/ca.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/ko_KR.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/es_ES.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/id.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/it_IT.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/pt_BR.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/pl.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/ru.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/pt_PT.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/th.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/uk.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/tr_TR.json"
[@formatjs/cli] [WARN] Error validating message "undefined" with ID "dropzone.Dropzone.invalidSizeLessError" in file "./src/i18n/messages/zh_CN.json"
TypeError: Cannot read properties of undefined (reading 'length')
at Parser2.isEOF (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:157458:47)
at Parser2.parseMessage (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:156929:22)
at Parser2.parse (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:156925:21)
at parse5 (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:157608:55)
at compile7 (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:159258:67)
at async Promise.all (index 3)
at async compileFolder (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:159319:19)
at async Command.<anonymous> (/Users/peterkulko/dev/paragon/node_modules/@formatjs/cli/bin/formatjs:164684:5)
- Dominant language
- JavaScript
- Stars
- 140
- Forks
- 100
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openedx/paragon
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100