PhpStorm not detecting file changes until focussing on another app - phpstorm

Been running into some issues with PhpStorm (v2020.3 on MacOS Big Sur 11.1) lately.
If I make changes to a file and save them, it doesn't trigger actions like a file transfer or recompiling (S)CSS when running npm run watch.
As soon as I focus another application (e.g. the browser for previewing) it detects the changed file and runs the needed action. This causes an annoying delay in my workflow.
At first I thought it had to do with Docker not updating the files in the container, however I now figured out it also does not work with a simple automated (s)FTP file upload/deplyoment.
Anyone else experiencing the same issue?
Cheers,
Allard

Fixed it by remapping the Save document shortcut under Preferences > Keymap. No idea how the shortcut got messed up, but hey, it works.

Related

How to test local changes to Chrome Extension

I am trying to fix a bug in a Chrome extension. I installed the extension from the web store. I found the error. I opened the installed files and made changes that may or may not fix the problem locally. I saved the changes. Now Chrome complains and says "This extension may have been corrupted."
I have no idea if the change will work. I do not want to go through the build process and upload the modified extension to the web store just to test a three line change.
How do I get Chrome to just use the modified extension? Or can I just ignore the "This extension may have been corrupted" error?
I think I figured it out. I was seeing the "This extension may have been corrupted" error because I made the changes in place, meaning directly in "${LOCALAPPDATA}\Google\Chrome\User Data\Default\Extensions${extension_dir}". When I instead made the changes to my Perforce workspace directory and used the "Load Unpacked" feature to install the extension from there it worked.

PhpStorm won't start - flashes logo then goes away

After restarting my PC and clicking the PhpStorm icon to launch it, the splash screen loads, then nothing does. PhpStorm will not open.
Three Step Solution
From this post (copied below in case the URL ever dies):
I had the same problem on the same day so perhaps it relates to a Windows update. (Edit - ignore that, my problem happened on January 17th, 2017 not 2016).
I renamed C:\Users\USERNAME.PhpStorm2016.3 to something else and it then started and allowed me to import my settings, which seems to have worked. I hope this helps others as this is much easier than rebuilding my Windows profile.
NOTE: On older versions of PhpStorm the path is C:\Users\USERNAME\.WebIde100
Upon restarting Windows after renaming my PhpStorm directory I tried to import the settings from my renamed C:\Users\USERNAME\OLD.WebIde100\config but got an error that settings.jar could not be found.
I closed PhpStorm and renamed my new .WebIde100 to NEW.WebIde100 and my OLD.WebIde100 back to .WebIde100. I did not have to restart my computer; launching PhpStorm again brought back my old settings.
I'm not sure why all this was needed, but it worked for me so I thought I'd share.

chrome extension reload on file change

I've been searching for-ever!
I`m working on windows and ubuntu, mostly on windows.
I searched the web for lot's of external libraries such as opn, open etc' but none of these could open this URL:
chrome://extensions
I want to put in the the script tag inside package.json
or in my build.js script
so that every time after I run "npm run build"
the chrome://extensions page will reload and also the additional page I`m testing on.
I once was able to do that exactly, but I lost that solution.
part of the problem is that I can't open chrome:
the ':' symbol is not recognized in the OS as valid protocol or something and it is escaped from chrome address bar if executed from command line.
I have tried many solutions.
I am not happy with the different resolutions proposed in the research I've made in Stack.O.
reloader as an extension is out of the question I want a script.
your kind help.
Assaf.
Clerc - for Chrome Live Extension Reloading Client
I built Clerc for exactly this purpose. npm run build won't be enough though. You need to hook up a LiveReload compatible server to watch for file changes, and clerc will listen for the reload messages.
Edit: Oh sorry. I missed the part where you said "reloader is out of the question". I still think this is your best option though.

Blank page on OpenShift-hosted site

I have site hosted on OpenShift with two pages. The main page works fine- loads right up. The second page, however, comes up totally blank. All of the sources are missing when I use Chrome's Inspect Element tool. The html file is blank and the additional subdirectories (js, css, etc) are just gone.
I'm not getting any errors in the log beyond a "js-bson: Failed to load c++ bson extension, using pure JS version" that I can't figure out but doesn't appear relevant.
The page worked fine for a while but started occurring today when I tried to change the content.
Why would this happen?
It sounds like you haven't committed the latest version of your files to your OpenShift git repository. You need to make sure to perform a git commit before doing a git push
If that isn't the problem, use the rhc ssh command detailed here to log into your application gear and see what files exist there. That may give you some clue as to what the problem is.

Chrome allow file access from files no longer working (was using to see WebGL/three.js files)?

I was using a Chrome shortcut with allow-file-access-from-files in the target to work on my three.js student project files. But sometime this morning this stopped working and it appeared Chrome had been updated. I redid the shortcut but no joy.
Part of the project I'm doing is building three.js animation that works in a common browser (for which I chose Chrome).
Is there any way to get Chrome to allow file access again?
Thanks.
The answer I came up with was to use Firefox instead of Chrome changing the security policy as detailed in https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally
Not a perfect answer but with a deadline looming it's the best workable answer for me right now as trying different variations of Chrome, trying Wamp and also Mongoose didn't work. If I had more time I would work out how to use Python or probably node.js as I've seen it mentioned a number of times as being the faster option.
What gman stated is true, using the Chrome flag (and changing Firefox's security policy) does create a big security risk. But only if you use that shortcut (and it's tabs etc.) for anything other than accessing your own local files. I've been scrupulous about not using it for the internet but don't use this method if you can't be strict with yourself.
Ideally I'd recommend beginning any project with node.js.
Gman's answer is good. If you're in windows environment, and use npm for package management the easiest is to install http-server globally:
npm install -g http-server
Then simply run http-server in any of your project directories:
Eg. d:\my_project> http-server
Starting up http-server, serving ./
Available on:
http:169.254.116.232:8080
http:192.168.88.1:8080
http:192.168.0.7:8080
http:127.0.0.1:8080
Hit CTRL-C to stop the server
Easy, and no security risk of accidentally leaving your browser open vulnerable.
DON'T USE THAT FLAG! You're opening yourself to having your online accounts being hacked and your local data stolen. Here are 2 proof of concept examples
Run a simple server.
It's super simple.
Here's one
Here's one.
Here's another.
And another.
They won't take more than a couple of minutes to download and require no configuration