-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
peek bug #35728
Comments
Thank you for the bug report. Could you please provide more information about what you were doing when you experienced the bug? For example:
This will help us track down the issue more effectively. Thank you! |
所有文本类型的文件(.js | .text | .css)等每次都不能预览,图片可以。 I've recently encountered a problem where I cannot preview any text files (.js, .text, .css, etc.). This issue has started happening in the current version. Image previews are unaffected. |
每次都会出现 |
My OS is Windows 11, 24H2 Chinese version. |
Thanks, @ppyds. Could you first try updating PowerToys to version 0.86. I have tried previewing .txt, .js, .css and other filetypes in that version and there weren't any issues. If that doesn't fix the bug on your machine, please could you:
The file includes the logs for each of the PowerToys tools, and will help to investigate the bug. Thanks again! |
The issue seems to be related to missing files in the following location:
Looking at the installer logs, the folder and files were created here instead:
(Missing the As a quick fix for this version, you could try copying the I will ask if anyone knows the root cause of the bug. Finally: how did you install and upgrade PowerToys? Has it always been the same way? Thanks! |
@htcfreek Could you direct someone with knowledge of the installer here, please? |
@Aaron-Junker , @stefansjfw , @jaimecbernardo @davidegiacometti |
Hi everyone! I checked what the installer is doing and also inspected the 0.85.0 installer: I can confirm that we aren't shipping Monaco sources in This is weird that the user is mentioning Peek but the error is related to Monaco PreviewHandler. This seems to another case #35831 My suspect is that the Peek Monaco previewer fail to be initialized due to the "missing file" and then Peek fallbacks to the shell preview handler previewer. This is how the directory is determined. PowerToys/src/common/FilePreviewCommon/MonacoHelper.cs Lines 34 to 47 in ce5e564
EDIT: based on
@ppyds deleting |
@ppyds deleting C:\Users\11535\AppData\Local\PowerToys\WinUI3Apps\Assets\Monaco should fix your issue 😃 按照这个步骤就好了,good Thanks you |
@davidegiacometti Thanks very much for analysing this in depth! Peek uses I assume the preview handler in Explorer was failing as well, but this isn't reported to the user. There are lots of errors in the user's
I wonder if this is related, or whether it's just a by-product of the Monaco language files being in the wrong place 🤔 |
Prompt in Chinese: 是的我的资源管理器也无法预览文本格式的文件 English translation: "Yes, my File Explorer is also unable to preview text format files." |
@daverayment Monaco preview pane is running out of process (even when hosted by Peek) under I guess the preview pane not working is a different problem. |
@davidegiacometti This is interesting! When the I think the solution would be to do an explicit check that the executing assembly's location is This would change the code in private static string GetRuntimeMonacoDirectory()
{
string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty;
// If the executable is within "WinUI3Apps", correct the path first.
if (Path.GetFileName(exePath) == "WinUI3Apps")
{
exePath = Path.Combine(exePath, "..");
}
string monacoPath = Path.Combine(exePath, "Assets", "Monaco");
return Directory.Exists(monacoPath) ?
monacoPath :
throw new DirectoryNotFoundException($"Monaco assets directory not found at {monacoPath}");
} Of course, we still don't know why the I will put a PR in to handle this. |
Microsoft PowerToys version
0.85.1
Installation method
Microsoft Store
Running as admin
Yes
Area(s) with issue?
Peek
Steps to reproduce
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
Other Software
No response
The text was updated successfully, but these errors were encountered: