Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS2353: Object literal may only specify known properties, and '<field>' does not exist in type 'PayloadDefault'. #162

Closed
bfontaine opened this issue Dec 22, 2023 · 1 comment

Comments

@bfontaine
Copy link

Hello, I use the latest version (2.4.2) and with TypeScript I get the above error when I use placeholders with t.get:

t.get("common.percentage", { percentage: 42 })

t.get('product.min_max_days', { min: value1, max: value2 })

I don’t have the issue with $t, but the above code is in a .ts file so per the docs I must use t.get.

#69 looks similar, but it was fixed.

I don’t know TypeScript enough to figure out how to fix this.

Any idea?

@bfontaine bfontaine changed the title TS2353: Object literal may only specify known properties, and 'percentage' does not exist in type 'PayloadDefault'. TS2353: Object literal may only specify known properties, and '<field>' does not exist in type 'PayloadDefault'. Dec 22, 2023
@Benjababe
Copy link

Updating the config by putting the placeholder names in the triangle brackets like here did the trick for me

const config: Config<
{
placeholder?: string;
value?: any;
count?: number;
}, /* Translation payload props */

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

No branches or pull requests

3 participants