@shikijs/monaco several themes that TypeError
taiyuuki opened this issue · comments
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
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