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

@shikijs/monaco several themes that TypeError #668

Open
3 of 5 tasks
taiyuuki opened this issue May 5, 2024 · 1 comment
Open
3 of 5 tasks

@shikijs/monaco several themes that TypeError #668

taiyuuki opened this issue May 5, 2024 · 1 comment

Comments

@taiyuuki
Copy link

taiyuuki commented May 5, 2024

Validations

Describe the bug

The monaco-editor version is 0.48.0, @shikijs/monaco v1.4.0

I tried all the themes from shiki, everything else is fine, but three themes that get errors

  • github-dark-default
  • github-dark-dimmed
  • vesper

The errors reported by github-dark-default and github-dark-dimmed

Uncaught (in promise) TypeError: color.charCodeAt is not a function
    at normalizeColor (index.mjs:117:18)
    at index.mjs:21:72
    at Array.map (<anonymous>)
    at textmateThemeToMonacoTheme (index.mjs:21:40)
    at shikiToMonaco (index.mjs:35:25)

I found that this issue is cause that the resulting symbolIcon.constantForeground field is an array, normally it should be a string.

And then the error reported by vesper is

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'foreground')
    at textmateThemeToMonacoTheme (index.mjs:11:22)
    at shikiToMonaco (index.mjs:35:25)

This issue is cause that in tokenColors, the settings field is missing for a item with the scope: ['markup.quote'] .

I'm not sure if these are issues with the themes offered by shiki, or if they are issues with shikiToMonaco, or just with the monaco-editor version. Can anyone please check?

Reproduction

https://github.com/taiyuuki/shiki-issue-typeerror

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@AmeroHan
Copy link

Errors occurred when using GitHub themes are caused by primer/github-vscode-theme#391, and Error occurred when using Vesper is because there is a scope without settings field. They mismatch interface IRawThemeSetting.

I don't know whether these theme JSONs (packages/tm-themes) are managed by program or not, can I edit them and pull a request?

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

2 participants