Cloud9 IDE serves old version of html page - javascript

I started a simple project with an HTML and a Java Script file. I ran the html file and everything was fine. I continued with the workspace on another machine and found that I could not see any changes I made to the html or js files when I refresh the browser panel in c9 IDE. It seems to keep serving a previous (cached?) version of the files. Restarting the run configuration (apache) did not make any difference.
How can I get the c9 IDE to run the latest files again?

Are you using Chrome? I had the same issue, I looked up and it was Chrome's fault. Started using the extension Cache Killer and that solved my problem.

Related

Can't get any files in the Content & Script folder to load in C# ASP.NET MVC application in VS

Having some problems here with a web application that was checked into a code repository.
Basically, this application in particular will not display any images, .js, or .css which are all located in the Content & Script folders. Only the raw HTML shows while running. This occurs specifically after doing a fresh pull from our code repository and running locally through Visual Studio. When you inspect the files in the console when its running, all the files are completely empty. The console is also giving a ERROR 500 error file not found (IIRC) The files are definitely in the project locally and they are showing in the Solution Explorer.
I am the only one who actively works on development for this application and I don't run into these problems with my machine. When you pull from the code repository on another computer, the problems start. However, no other applications with an extremely similar architecture have this problem after pulling fresh for the repository. I tried creating brand new web applications with exact same settings and files on the computers affected and they loaded perfectly.
The link to the file looks normal too, it matches with the production server which works.
The application is using bundles and most of the bundles look like this:
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.min.js",
"~/Scripts/bootstrap-datepicker.min.js",
"~/Scripts/bootstrap-timepicker.js",
"~/Scripts/bootstrap-confirmation.js",
"~/Scripts/respond.js",
"~/Scripts/bootstrap-select.min.js"));`
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.min.css",
"~/Content/bootstrap-datepicker.min.css",
"~/Content/bootstrap-timepicker.css",
"~/Content/bootstrap-sortable.css",
"~/Content/site.css",
"~/Content/bootstrap-select.min.css"));
Things I have tried:
Adding the .js and .css files in _Layout.cshtml page manually instead
of with bundle.
Replacing all the normal files with .min.js or .min.css and vice
versa
Changing authentication methods for access
Changing permissions on Content Folder
Recreating virtual directory
Using Visual Studio 2017 and 2019
I am stumped, anyone have any suggestions or recommendations? I can answer any questions that arise.
You'll need to commit/push .csproj file as well, this file has link to all your files in the project.

node typescript client-side debug

Is is possible to debug (breakpoints, watches) client-side .ts typescript files from visual studio (2015) directly? Most of the related issues that I have found on google and stackoverflow suggest using other browser devtools such as chrome. Is it possible to do it in visual studio?
When I create a .ts script (say index.ts), it will be transpiled into a index.js which will then be referenced from the corresponding index.html file in the script tag.
How can I set breakpoints in the .ts file (although it is the .js which is referenced?)
It is possible with IE. You have to set "Browse with" to Internet Explorer and in the project properties/web unchecked all debuggers. Than you should be able to debug client-side TS in VS.
I figured out that I can debug in visual studio but launching a a new debug session from internet explorer: menu->view->external script debugger which will start a new visual studio ide with all my files (.js and .ts mapped) loaded. I just have to make sure that the .js and .ts files are in the same directory (example: ./public/js/ ). It is not a perfect solution (for example bringing the cursor over a variable does not show the variable value. You must manually open the watch window...) But it allows me to step through my .ts files thus keeping a unified development environment: typescript with node.js on the server, typescript on the client-side within the same solution
You might try with this HTML Application with TypeScript project template from Web Essentials 2015 extension, as suggested in this post from Telerik blog.
If that works, it seems just a matter of usual VS scenario "set breakpoint; hit F5".

Debugging JavaScript with Flask and PyCharm

I just installed the professional version of PyCharm for its Flask features, but I'm having a lot of issues getting anything JavaScript related working.
Firstly, is there any way of getting the browser to open when you run the flask project? There doesn't seem to be a Flask run configuration, which means you have to use the default Python configuration, and that doesn't have the option to run a browser. I tried making a JavaScript Debug project that runs the server as a Before Launch command, but it still doesn't open the browser (either Chrome or Firefox)
Secondly, how do I get PyCharm to hit the JavaScript breakpoints? Even if I manually browse to the flask server (http://localhost:5555/), Intellij doesn't hit breakpoints in my JavaScript, even though the JetBrains plugin is installed (again, in both Firefox and Chrome). I suspect this may be related to the fact that PyCharm doesn't open the browser, which is why I mentioned that as my first point.
Can anyone with experience in PyCharm or IntelliJ help me out?
Just solved this problem.
You need some setup steps.
My prerequisites:
PyCharm on my local laptop
I'm developing on remote virtual machine (droplet DO, Ubuntu)
Setup you web-server. It should be Apache, nginx whatever.
Setup you web-app. You web-app should be runned on web-server.
Setup your debug configuration:
a. Run->Edit configuration
b. Add->JavaScript debug
c. Specify you URL as real url from web-browser like:
http://YOUR_IP:YOUR_PORT/directory/category
d. Specify File/Directory of HTML template and remote URL where your template located.
e. Debug it.
f. Profit ! :)
P.S. So lovely evaluate JavaScript variables from familiar PyCharm tool :)
P.S2: Almost forgot: Need install Chrome extension: https://www.jetbrains.com/help/pycharm/2016.3/debugging-javascript.html#d615717e345

rails precompile Why javascript does not work locally but at heroku it works

So, the app was working great locally until I precompiled the assets. When deploying to heroku I did assets precompile and then deployed and it worked fine at heroku, but now it seems javascript got broken.
Any suggestions on how to solve it? Should I delete the files at public folder or use some configuration?
Thanks in advance
UPDATE
I get one of this for each asset file I load in development mode, is it normal?
Started GET "/assets/home.js?body=1" for 127.0.0.1 at 2012-06-15 19:16:48 +0100
Served asset /home.js - 304 Not Modified (0ms)
This is odd. I'm using twitter bootstrap and now to test if javascript is messed up I added a tooltip html example to check if it is also crashed and it actually worked.
But my dropdown at menu bar does not work. How strange is this?
Finally I solved the problem.
Just changed in config/environments/development.rb
config.assets.debug = true
to
config.assets.debug = false
And now javascript works as expected
UPDATE
Now when I have this problem I actually run rake assets:clean and clean the browser cache. This will make your app work as it used to work in development work.
If you want to have a better process, you could instead create a new branch where you run precompile and keep your master branch clean.
Other alternative is to run precompile on heroku so you don't have to do it locally. I haven't tried it yet but there is a 'beta' feature you have to enable so this can work properly in all apps. You can read about it here

Phantom.js doesn't run from the OSX console

I'm developing an ExtJS app and I'd like to render the view as pdf using Phantom.js. I've downloaded binary package for OSX, after unpacking added a symlink to it as well as added it to the PATH. After running 'phantomjs' in the console I get :
phantomjs script.js
And that's all. When I try running any of the example scripts it crashes saying that require is undefined, I can't check the version and basically it's unusable. I can run the bat file though, and it gives me phantomjs shell. After removing all I've downloaded previously I can still run 'phantomjs' command with the same outcome. Probably because Sencha's SDK have it but it's not visible in the PATH so I'm not sure. Any ideas ?
as always found the problem seconds after submitting question. Sencha's SDK had some custom or broken version of phantomjs.bat, and the whole folder was added to the PATH.

Categories