Skip to content

fix: @lingui/cli type error when catalog is missing#988

Merged
semoal merged 1 commit into
lingui:mainfrom
capaj:fix-type-error-when-missing-catalog
Mar 1, 2021
Merged

fix: @lingui/cli type error when catalog is missing#988
semoal merged 1 commit into
lingui:mainfrom
capaj:fix-type-error-when-missing-catalog

Conversation

@capaj
Copy link
Copy Markdown
Contributor

@capaj capaj commented Feb 26, 2021

  • some formatting-seems like the codebase was not formatted when prettier was upgraded to major version 2

  • fixes this type error:

> cd back-end && lingui compile

Compiling message catalogs…

/home/capaj/work-repos/looop/project-alpha/node_modules/@lingui/cli/api/catalog.js:236
        if (!catalogs[locale].hasOwnProperty(key)) {
                              ^
TypeError: Cannot read property 'hasOwnProperty' of undefined
    at getTranslation (/home/capaj/work-repos/looop/project-alpha/node_modules/@lingui/cli/api/catalog.js:236:31)
    at getMultipleFallbacks (/home/capaj/work-repos/looop/project-alpha/node_modules/@lingui/cli/api/catalog.js:272:18)
    at Catalog.getTranslation (/home/capaj/work-repos/looop/project-alpha/node_modules/@lingui/cli/api/catalog.js:278:9)
    at /home/capaj/work-repos/looop/project-alpha/node_modules/@lingui/cli/api/catalog.js:218:23
    at XWrap.f (/home/capaj/work-repos/looop/project-alpha/node_modules/ramda/src/mapObjIndexed.js:39:16)
    at XWrap.@@transducer/step (/home/capaj/work-repos/looop/project-alpha/node_modules/ramda/src/internal/_xwrap.js:17:17)
    at _arrayReduce (/home/capaj/work-repos/looop/project-alpha/node_modules/ramda/src/internal/_reduce.js:18:34)
    at _reduce (/home/capaj/work-repos/looop/project-alpha/node_modules/ramda/src/internal/_reduce.js:60:12)
    at mapObjIndexed (/home/capaj/work-repos/looop/project-alpha/node_modules/ramda/src/mapObjIndexed.js:38:10)
    at Object.f2 [as mapObjIndexed] (/home/capaj/work-repos/looop/project-alpha/node_modules/ramda/src/internal/_curry2.js:34:14)

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 26, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/lingui-js/js-lingui/B7gpsxQDZxYrQsTBpajVVzdp97ZB
✅ Preview: https://js-lingui-git-fork-capaj-fix-type-error-when-missin-2404d0.vercel.app

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2021

Codecov Report

Merging #988 (880a9c4) into main (77ec0bd) will decrease coverage by 0.08%.
The diff coverage is 52.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #988      +/-   ##
==========================================
- Coverage   83.30%   83.21%   -0.09%     
==========================================
  Files          53       53              
  Lines        1605     1609       +4     
  Branches      430      431       +1     
==========================================
+ Hits         1337     1339       +2     
- Misses        156      157       +1     
- Partials      112      113       +1     
Impacted Files Coverage Δ
packages/cli/src/api/catalog.ts 81.56% <52.63%> (-0.60%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77ec0bd...880a9c4. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants