subfont: Subfont never finishes
Hello! Suddenly the subfont is stuck at populate.
> subfont --root ./dist --canonical-root https://blog.ashrimp.dev/ --output ./dist-opt --inline-css --no-fallbacks --debug ./dist/**/*.html
✔ 0.005 secs: logEvents
✔ 0.541 secs: loadAssets
⚠ WARN: dist\posts\meteorknight-engine-devlog-1\vid\demo.mp4 - spawn file ENOENT
Including assets:
dist\posts\meteorknight-engine-devlog-1\index.html
✔ 0.256 secs: populate
✔ 0.012 secs: checkIncompatibleTypes
✔ 0.007 secs: applySourceMaps
⚠ WARN: dist\posts\meteorknight-engine-devlog-1\vid\demo.mp4 - spawn file ENOENT
Including assets:
dist\posts\meteorknight-engine-devlog-1\index.html
✔ 0.017 secs: populate
And it never finishes without any additional output. What things should I check? Thank you!
EDIT
After long waiting, below is printed.
<--- Last few GCs --->
[17268:0000016D46B30090] 1848042 ms: Mark-sweep (reduce) 327.1 (413.1) -> 326.7 (357.2) MB, 262.8 / 0.0 ms (average mu = 0.182, current mu = 0.088) last resort GC in old space requested[17268:0000016D46B30090] 1848352 ms: Mark-sweep (reduce) 326.7 (357.2) -> 326.7 (347.7) MB, 310.0 / 0.0 ms (average mu = 0.092, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 00007FF7E492DF0F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+113567
2: 00007FF7E48BD736 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+67398
3: 00007FF7E48BE5ED node::OnFatalError+301
4: 00007FF7E52B0CAE v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF7E529B2FD v8::Isolate::Exit+653
6: 00007FF7E513EC5C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
7: 00007FF7E5139BCE v8::internal::Heap::AllocateExternalBackingStore+2174
8: 00007FF7E5156ADA v8::internal::Factory::CodeBuilder::AllocateCode+106
9: 00007FF7E51570A4 v8::internal::Factory::CodeBuilder::BuildInternal+580
10: 00007FF7E5156D46 v8::internal::Factory::CodeBuilder::Build+22
11: 00007FF7E4C194B3 v8::internal::RegExpMacroAssemblerX64::GetCode+4259
12: 00007FF7E4EBD4E1 v8::internal::RegExpErrorString+8993
13: 00007FF7E4EA769E v8::PropertyDescriptor::value+5294
14: 00007FF7E4EA7ACE v8::internal::RegExp::CompileForTesting+526
15: 00007FF7E4EA80C8 v8::internal::RegExp::DotPrintForTesting+248
16: 00007FF7E4EA8FFB v8::internal::RegExp::ExperimentalOneshotExec+2491
17: 00007FF7E4EA8B1E v8::internal::RegExp::ExperimentalOneshotExec+1246
18: 00007FF7E4EA8587 v8::internal::RegExp::Exec+199
19: 00007FF7E4E838FC v8::internal::DeclarationScope::was_lazily_parsed+21260
20: 00007FF7E5343281 v8::internal::SetupIsolateDelegate::SetupHeap+513585
21: 00007FF7E53A0AA6 v8::internal::SetupIsolateDelegate::SetupHeap+896598
22: 0000016D503CB7C9
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 30
You’re welcome, happy that you found a way to avoid it. If you feel that there’s a bug in
font-tracer, please give me a hint 😇I’m sure we can figure that out together!
Ah, wow, nice work!
After many, many tries, I finally profiled the
subfont, and got some critical informations.Look at this:
The
DOMExceptiontakes most of the time. So I added some debug logs to know what’s going on.And here’s the output:
What is it? It tries to select pseudo-class
:-translateand similar. And yes, they came from thetailwindCSS. ThetailwindCSSuses special character:for class names by escaping it with\. So the cause is so obvious now. The logic for extracting all used CSS selector does not handle escapes correctly. I’m not sure what part is wrong for now, but I’ll comment here when it’s done.Yes.
Thanks. No, it doesn’t need the video files, so we’re in bug territory 😃