Clickable file with line number link in Intellij console output on Windows - windows

Firstly, I'm using Intellij IDEA 2021.3.4 (Community Edition).
And in my project there is an XML file, and Java code which validates the XML files.
As part of the validation, if there is an error detected then the absolute file path and line number are printed to the console in the format:
file:///Users/rob/git/project/src/main/resources/com/app/test/Page.xml:6
I'm on Mac, and the log message is clickable. If I click on it then the IDE opens that file at the specified line number.
However, this same feature does not work when on Windows.
I've tried logging the message in various formats but none work.
Is the problem with the format of my log message, or just an issue with Intellij on Windows?
Various formats I've tried on windows:
file://C:\\Users\\rob\\git\\project\\src\\main\\resources\\com\\app\\test\\Page.xml:6
file://C:\\\\Users\\\\rob\\\\git\\\\project\\\\src\\\\main\\\\resources\\\\com\\\\app\\\\test\\\\Page.xml:6
file://C:/Users/rob/git/project/src/main/resources/com/app/test/Page.xml:6

Related

VS Code debugger: failure to find module (utf-8 characters)

When I try to run a Node.js debugging session from Visual Code, the debugging console returns an error, saying that the bootloader.bundle.js could not be found. However, the bootloader.bundle.js file exists at the expected location, while the debug console specifies the folder incorrectly by substituting a UTF-8 character (letter č) with the replacement character (�). The snippet of the error message can be found below:
Error: Cannot find module 'c:/Users/xxxx xxxx�/AppData/Local/Programs/
Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js'
Can I somehow fix this in VS Code, perhaps by modifying the launch.json file in some way or some other settings?
Any help is appreciated!
EDIT:
I temporarily fixed the issue by reinstalling VS Code to another folder without that doesn't include diacritical characters. I'd like to to keep this question open, however, in case somebody knows of a way to fix this sort of problem (e.g. by by modifying some configuration files) that does not require either reinstalling or relying on a portable version of the app.
I have just dealt with the same issue. There have been Unicode characters in my folder's path and I got the same error "Cannot find module". Reasons are described in details here.
To fix it I have gone to File - Preferences - Settings and then entered "usePreview" and then I unchecked the option "Use the new in-preview JavaScript debugger for ..." under the section "Debug > JavaScript: Use Preview" and reloaded VS Code. The issue has gone.

"Error in parsing the app package." when opening Windows 10 .appinstaller file from web (MSIX)

So I'm trying to use the direct app install feature of Windows 10 Creators Update to allow downloading a packaged modern app from the web. The key feature of it is that it will auto update your app by checking back to the same URL of the .appinstaller file.
https://new-file-explorer.firebaseapp.com/ (the page is entirely generated by Visual Studio, no modifications from me)
The problem is that when I click it I just get "Error in parsing the app package."
If I manually download the .msixbundle that's referenced in the .appinstaller file it will work! Yet App Installer itself can't "parse" this package?
Here's the weirdest part: if I use "Add-AppxPackage -Appinstaller" from Powershell and point it towards the .appinstaller URL it will completely work!
The other answers on here do not apply, since they were all related to running it on a local server (I tried it anyways).
I thought this was related to MIME types, but I have set the MIME types as stated in the documentation and yet it still doesn't work. I've verified that by using this URL MIME type checker. I'm at a loss to what is actually causing this.
Here is the .appinstaller file:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller Uri="https://new-file-explorer.firebaseapp.com/InstallNFE.appinstaller" Version="1.0.9.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">
<MainBundle Name="NewFileExplorer" Version="1.0.9.0" Publisher="CN=david" Uri="https://new-file-explorer.firebaseapp.com/InstallNFE_1.0.9.0_Test/InstallNFE_1.0.9.0_x86_x64.msixbundle" />
<UpdateSettings>
<OnLaunch HoursBetweenUpdateChecks="0" />
</UpdateSettings>
</AppInstaller>
Here's a link to the .msixbundle it appears to be incapable of parsing (as you can see, it works manually downloading it!)
Thought of putting the solution in case someone else is facing the issue. I also faced the same issue and was able to resolve myself. When opening the Windows 10 .appinstaller file from web, the error "Error in parsing the app package." occurs.
For me the cause was that the links provided in the HTML page index.html generated by Visual Studio was referring to some share location (as my installer location was a file share location) and the installer file was not there. The reason for this is that I didn't do the last step "Copy and Close" of publishing from VS (this step copies the installer from output location to installer location that you provided). Instead of "Copy and Close", I just clicked on another option "Close" and hence the issue.
Just an additional input as i also encountered this issue and spent a whole day of finding the fix.
Let me just copy a line from .appinstaller file of the original poster.
<MainBundle Name="NewFileExplorer" Version="1.0.9.0" Publisher="CN=david" Uri="https://new-file-explorer.firebaseapp.com/InstallNFE_1.0.9.0_Test/InstallNFE_1.0.9.0_x86_x64.msixbundle" />
In this line, it only specify as ".msixbundle" file but the actual file in local folder is ".msixbundle.zip".
After I removed ".zip" from the filename of the file, the issue is gone.

Does Angular CLI prevent timestamp update for *.TS files?

After setting up an Angular 2 program using Angular CLI (following the procedure at https://angular.io/guide/quickstart) and using VS Code (https://code.visualstudio.com/) to work with the files I've noticed that the file timestamps for *.TS files do not get updated. Testing on Windows 10, the problem occurs even if I make a change to a TS file with Notepad and do so immediately after reboot. However, if I copy the TS files to another folder, they show updated timestamps.
When opening other folders, there is an instant display of files, but when opening the app folders with the TS files, there is a delay of several seconds, with a message "Working on it..."
The TS files had been associated with a video processing program ("transport stream" file), but I shifted the association to VS Code, but that didn't fix the problem.
I opened a bug report at https://github.com/Microsoft/vscode/issues/25569 but the VS Code folks could not reproduce the problem, suggesting that it is not seen for many VS Code users. That report is now is some sort of limbo in which it is listed as closed but one can still comment.
So I'm wondering whether the Angular CLI environment prevents timestamp update for the TS files.
Any suggestions on how to get the TS files in an Angular 2 project to show the current timestamp?
Addendum: the problem is not just for ts files. It extends to css files as well, as illustrated in this image in which the file system lists 19 April as the file date for styles.css, but the ToolTip for the file gives the more recent (correct) date:
Clearly some part of this environment is overruling one of 2 displays of the file date.
The problem is not the timestamp; it is the column displayed in Windows Explorer. Instead of the usual "Date Modified" column, "Date" was displayed. I don't think problem is caused by Angular CLI or VSCode. It looks like it is created by the video processing program ("transport stream") file type assignment; removing that file association and assigning *.ts to VSCode prevents the problem from occurring. However, this doesn't fix instances in which it occurred already; here is how to fix those:
In Windows Explorer click View on the menu, then "Add Columns". Uncheck "Date" and check "Date Modified". You may want to remove "Length" as well.

OS X Firefox lockPref configuration error

I am having issues getting lockPref working on my Mac. I have followed instructions here, as well as looking in other places for solutions. I have created a mozilla.cfg file, as well as a local-settings.js file in /Applications/Firefox/Contents/Resources/defaults/pref, as follows:
mozilla.cfg
//
lockPref("extensions.shownSelectionUI", true);
lockPref("extensions.autoDisableScopes", 11);
local-settings.js
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");
These are both saved using Windows Latin encoding (have tried Windows Roman too). When opening Firefox, I am getting an error dialogue saying, "Failed to read the configuration file. Please contact your system administrator". I'm not sure where to go from here, as other solutions have involved UTF encoding problems and incorrect configuration values - I saved an empty mozilla.cfg file to attempt to rule that out, and the problem still persists.
FYI I'm using OS X 10.11.5 and Firefox 42.0. Thanks.
So, I didn't have mozilla.cfg in the correct location - I was storing it in the prefs folder with the local-settings.js, which is incorrect.
File locations are now as follows:
/Applications/Firefox.app/Contents/Resources/mozilla.cfg
/Applications/Firefox.app/Contents/Resources/defaults/pref/local-settings.js

"open in IE 1.4" addon stopped working

Whenever I press on the open in IE icon, I get an error in the console:
Error: NS_ERROR_FILE_NOT_FOUND: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIProcess.init]
Source File: chrome://openinie/content/openinie.js
Line: 126 (This happened ever since upgrade to 16.0 and I assume it's probably security related)
I found that js file to be inside some "openinie#wittersworld.com.xpi" file (which I cleverly renamed to zip), and saw the offending line:
var iePath = openinie.getIEPath();
// create an nsILocalFile for the executable
var file = Components.classes["#mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(iePath);
// create an nsIProcess
var process = Components.classes["#mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
process.init(file); // <-line 126
is it possible to fix it and "re-compile" it zipping and renaming?
(I assume it's something with security maybe).
can I debug this using for example an alert box to display values of variables?
is it possible to fix it and "re-compile" it zipping and renaming
Yes, you can simply replace a file in the ZIP archive, most extensions aren't signed (you can remove the META-INF directory from the XPI file if this one is). In fact, for your debugging it is better to unpack openinie#wittersworld.com.xpi into a directory named openinie#wittersworld.com in the same folder and remove the original file - this way you won't need to pack/unpack on each change. You should also start Firefox with the -purgecaches command line parameter, otherwise the file you are changing might get cached.
can I debug this using for example an alert box to display values of variables?
Yes. However, I would rather recommend Components.utils.reportError() method that will log to the Error Console (press Ctrl-Shift-J to open it) without opening modal dialogs. In this particular case I would write:
Components.utils.reportError(iePath);
This seems to point to a non-existent file meaning that the getIEPath() function is faulty.
Good luck!

Resources