question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid Message Catalogs Generated

See original GitHub issue

Using 3.0.0-13 to 3.0.0-16 after an extract and compile, I’m getting the following error:

Argument of type '{ messages: { "API.greenlight_status.invalid_email": string; "API.sessions.invalid_email": string; "API.sessions.invalid_password": string; "API.sessions.invalid_phone": string; "DashboardPage.child_care_footer": string; ... 156 more ...; "{0, plural, one {child} other {children}}": (string | { ...; })[][]; }; }' is not assignable to parameter of type 'Record<string, CompiledMessage>'.
  Property 'messages' is incompatible with index signature.
    Type '{ "API.greenlight_status.invalid_email": string; "API.sessions.invalid_email": string; "API.sessions.invalid_password": string; "API.sessions.invalid_phone": string; "DashboardPage.child_care_footer": string; ... 156 more ...; "{0, plural, one {child} other {children}}": (string | { ...; })[][]; }' is not assignable to type 'CompiledMessage'.
      Object literal may only specify known properties, and '"API.greenlight_status.invalid_email"' does not exist in type '(string | [string, (string | undefined)?, (string | Object | undefined)?])[]'.  TS2345
     3 | import en from './locales/en/messages.js'
       |
     5 | 
     6 | export const i18n = setupI18n()
  >  7 | i18n.load('en', en)
       |                 ^
     8 | i18n.load('es', es)
     9 | i18n.activate('en')

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
semoalcommented, Oct 17, 2020

The problem is you’re importing messages.js as default, you must extract the messages

import { messages as enMessages } from './locales/en/messages.js'
      
export const i18n = setupI18n()
i18n.load('en', enMessages)
0reactions
tricoder42commented, Oct 20, 2020

It was just published in 3.0.0-20

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating message catalogs - IBM
Create your own message catalogs to write tailored entries to the local error log.
Read more >
3 Creating and Using Message Catalogs
Message catalogs are generated from message text source files that contain error and informational messages, prompts, background text for forms, ...
Read more >
Failed to generate catalog. This is error is seen when arcserve ...
ARCserve D2D File System Catalog job would fail with the following error message, Failed to generate catalog file for volume C:. Failed to...
Read more >
Catalog Client Script now showing error message - ServiceNow
Solved: Hi Community, I have written a catalog client script to validate length of one of my variables in a catalog item.
Read more >
Error with Catalog - SAP Community
Hi, We have created a CATALOG and when we select the CATALOG and click on "EDIT" or "UPLOAD" button we are getting an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found