react-ace
react-ace copied to clipboard
TS error in VirtualRenderer interface
Getting the following error in version 1.5.3 of ace-builds.
node_modules/react-ace/lib/types.d.ts:124:11 - error TS2430: Interface 'IRenderer' incorrectly extends interface 'VirtualRenderer'. Types of property 'scroller' are incompatible. Type 'HTMLDivElement | undefined' is not assignable to type 'HTMLElement'. Type 'undefined' is not assignable to type 'HTMLElement'.
124 interface IRenderer extends Ace.VirtualRenderer { Found 1 error in node_modules/react-ace/lib/types.d.ts:124
Fixed by downgrade to version 1.5.0 of ace-builds.
I tried doing this (downgrading to v1.5.0), but it did not fix the issue for me. I'm getting the same error. Can someone please help me out?
Having the same problem with ace-builds v1.6.0 (Typescript project)
node_modules/react-ace/lib/types.d.ts:124:11 - error TS2430: Interface 'IRenderer' incorrectly extends interface 'VirtualRenderer'.
Property 'scroller' is optional in type 'IRenderer' but required in type 'VirtualRenderer'.
I believe this dependabot PR is related https://github.com/securingsincity/react-ace/pull/1559
By the way this is happening with skipLibCheck: false. Setting it to true makes it work, however now your d.ts files aren't checked anymore (if you're using any)
I'm having the same error. Will this be addressed any time soon?
Also having this problem with typescript (using next.js too).
Downgrading to ace-builds to 1.5.0 didn't fix the error, nor did setting skipLibCheck: true in .tsconfig (next.js sets this by default, actually).
Any solutions in the pipes?
skipLibCheck: true in .tsconfig does work for React apps without downgrading ace-builds. Should be a good resolution till they provide a fix.
In our project we patched the type since its such simple fix, would be nice if it would get fixed for real tho
Here is the diff that solved my problem:
diff --git a/node_modules/react-ace/lib/types.d.ts b/node_modules/react-ace/lib/types.d.ts
index 3fbd75b..569482c 100644
--- a/node_modules/react-ace/lib/types.d.ts
+++ b/node_modules/react-ace/lib/types.d.ts
@@ -123,7 +123,7 @@ export interface IAnnotation {
}
interface IRenderer extends Ace.VirtualRenderer {
placeholderNode?: HTMLDivElement;
- scroller?: HTMLDivElement;
+ scroller: HTMLDivElement;
}
export declare type IAceEditor = Ace.Editor & {
renderer: IRenderer;
This diff was generated by patch-package.