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

Compilation error with Typescript #555

Open
c-classen opened this issue May 1, 2023 · 0 comments · May be fixed by #556
Open

Compilation error with Typescript #555

c-classen opened this issue May 1, 2023 · 0 comments · May be fixed by #556
Assignees
Labels
types Need an update to types

Comments

@c-classen
Copy link

The file dev-warnings.ts contains the following line:

if (typeof window !== 'undefined' && window[isDisabledFlag]) {

which Typescript in my configuration does not accept, since the isDisabledFlag is not a known field of the window object (My configuration should be close to the default NextJS configuration):

Type error: Element implicitly has an 'any' type because index expression is not of type 'number'.

This can be fixed by adding an explicit any cast:

if (typeof window !== 'undefined' && window[isDisabledFlag as any]) {
@100terres 100terres self-assigned this Jun 21, 2023
@100terres 100terres added the types Need an update to types label Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Need an update to types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants