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.

[next-i18next] 9.0.8 -> 9.1.0: Type 'unknown' is not assignable to type 'never'.

See original GitHub issue

My toast() calls complain about the type now, especially when using next-i18next’s t():

toast(t(‘test.test’))

casting to string works, but isn’t that pretty. Any chance to get the old behaviour back or was this a typescript optimization?

Argument of type 'ToastContent<never>' is not assignable to parameter of type 'ToastContent<unknown>'.
  Type '(props: ToastContentProps<never>) => ReactNode' is not assignable to type 'ToastContent<unknown>'.
    Type '(props: ToastContentProps<never>) => ReactNode' is not assignable to type '(props: ToastContentProps<unknown>) => ReactNode'.
      Types of parameters 'props' and 'props' are incompatible.
        Type 'ToastContentProps<unknown>' is not assignable to type 'ToastContentProps<never>'.
          Type 'unknown' is not assignable to type 'never'.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fkhadracommented, Nov 24, 2022

Thanks for the update. I’ll close the issue

1reaction
Zerebokepcommented, Nov 3, 2022

Really appreciate your effort, you rock.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is "not assignable to parameter of type never" error in ...
I get the following TS error: [ts] Argument of type 'string' is not assignable to parameter of type 'never'. What am I doing...
Read more >
TS throw `Type instantiation is excessively deep and possibly ...
To Reproduce Expected behavior No errors Your Environment runtime ... [next-i18next] 9.0.8 -> 9.1.0: Type 'unknown' is not assignable to ...
Read more >
type 'unknown' is not assignable to type 'reactnode' - You.com
Argument of type 'ToastContent<never>' is not assignable to parameter of type 'ToastContent<unknown>'. Type '(props: ToastContentProps<never>) => ReactNode' is ...
Read more >
Type 'any' is not assignable to type 'never' : r/typescript - Reddit
Typescript noob here. Why can't I index my object and change the value with variable key? interface Menu { id: string; required: boolean; ......
Read more >
Type '{}' is not assignable to type 'never'. react Code Example
const result : string[] = [];
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