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

ace-builds/src-noconflict/ext-themelist: None of the types work anymore after upgrading from 1.36.5 to 1.37.5 #5723

Open
MartinXPN opened this issue Jan 25, 2025 · 4 comments

Comments

@MartinXPN
Copy link

Describe the bug

I had the following code in my React code:

import {themesByName} from 'ace-builds/src-noconflict/ext-themelist';
type ThemeType = keyof typeof themesByName;         // <- This results in `never` (used to be all the theme keys)


// ....

if (disablePasting) {
    editorInstance.on('paste', e => e.text = '');      // <- This results in an error "TS2339: Property text does not exist on type string"
    document.addEventListener('paste', e => e.preventDefault());
}

Expected Behavior

The types should be recognized properly and Typescript shouldn't result in an error.

Current Behavior

The project fails to run. So, I had to revert back to the 1.36.5 version.

Reproduction Steps

Include the code above in a Reac + Typescript project. Try to access the themesByName object.

Possible Solution

No response

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

ace: 1.37.5, browser: chrome, os: mac

@nightwing
Copy link
Member

@MartinXPN thank you for the report! the attached pull request fixes the type errors.

But are you sure that themesByName returned theme names? for me with 1.36.5 themesByName has type any and ThemeType is string | number | symbol

@MartinXPN
Copy link
Author

@nightwing Thanks for investigating this so quickly!
Yeah, you're right, the ThemeType was string | number | symbol.

@nlujjawal
Copy link
Contributor

Hi @MartinXPN
I hope the types are working fine now, Or still do you see any issue.

@MartinXPN
Copy link
Author

I haven't tested the latest version, to be honest. Do we have a new NPM release that I can use to test things out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants