potentially fix monaco editor build bug #9690
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this will fix the bug that rare build issue that caused microsoft/pxt-arcade#6077. The bits leading me to think that are that it's pointing at
/codicons/codicon/codicon.ttf
while grabbing the editor.css, which matches the error we gotand that
inlineCodiconFont
's job is to replace that relative path with an inline font - so the replace in that fn is not being applied to the end result (it's just a few lines above this change). It's a bit hard to induce the bug, but I think it's a race condition with thefs.readFileSync
vsgulp.src
ininlineCodiconFont
andcopyMonacoEditor
functions, where it normally runs fine but very rare fs lag causes inlineCodiconFont to get applied first then overwritten. I guess I can try inducing it by throwing in afor (let i = 0; i < 10000000000; i++) {i ++}
or something in copyMonacoEditor?I did a local serve and uploadtrg and both have icons as expected, it also just makes sense that the mutation of the file should not be running parallel to copying the file~
(I also kinda wonder if this was the cause for comment on line 504 -- it's fetching from the cdn relative to the .css file, but the path at the end is just for reference / the hash is what matters, so it was always pulling in the css and trying to use it as ttf. Probably the right fix though as would maybe be a bit of a headache to replace in the right cdn path)