Local JS files not loading/running on Heroku - javascript

I'm running a nodejs application on Heroku. For simplicity's sake, I went through Heroku's example application steps. Once the application was up and running, I created a public/js/test.js file which contained a simple alert( 'testing' ); command.
I then came back to the view/partials/header.ejs file and included the new test.js file appropriately. Obviously, all of this works as intended locally - but when I push it to Heroku I get no alert. When I check source using developer's tools I see that it found the js file, but clicking on it reveals an empty file.
I assume that Heroku must require some sort of build step for this - but I haven't been able to find a specific path to getting it working. Any help would be appreciated!

So, it turns out that the Brave browser was interfering with the javascript file. I've never known Brave to cause a problem like this (and locally Brave did not break it). The issue must have something to do with how Heroku loads some of the static files.
Hopefully posting this answer will help someone else encountering the same issue.

Related

Old mapping showing up with Workspaces. How can I establish a new mapping and/or close out a previously used port?

So this is a follow up question to an earlier question I had regarding a Udemy course on "Advanced Javascript I am taking. I am currently trying to follow along with a lesson on IIFE.
The instructor is using Chrome DevTools to show JS examples, and created the following three snippets - main.js, other.js, index.html.
As per an earlier question I had answered, it appears that the instructor is using Workspaces to map files from a local directory to work on them in Chrome DevTools (otherwise the index.html wouldn't function in DevTools just using snippets)
So... I paused the Udemy course to complete this short Workspaces demo. After completing the demo, I went back to the Udemy course, created a local directory with the main.js, other.js, and index.html files and tried to follow the instructions per the Workspaces demo for my Udemy files.
However, after running in my js-advanced/IIFE directory and navigating to localhost:8000 in Chrome, I still see the old index.html from the Workspaces demo. Even after navigating to Sources > Filesystem and opening up the new folder, I can't get the page to map to my new directory.
I am assuming that there's something I'm missing regarding ports being opened and not closed after following the tutorial. But maybe not. Can someone please explain what I'm doing wrong?
P.S. I'm technically using Brave Browser but it's built on top of Chrome so I don't think that should matter.

Debug JavaScript in IntelliJ IDEA

How can I debug JavaScript for my website in IntelliJ IDEA without changing my build configuration?
I am able to debug the JavaScript in Chrome Console but it does not work very well.
Answer. It is really easy:
Create a new JavaScript Debug Run configuration and specify the WAMP address you normally use to open your application in browser as URL there. See https://www.jetbrains.com/help/webstorm/2017.2/debugging-javascript-in-chrome.html#d45520e154 and linked topics.
You might also need to configure URL mappings in your configuration - https://www.jetbrains.com/help/webstorm/2017.2/debugging-javascript-deployed-to-a-remote-server.html#d46122e202
First you need to add intellij plugin for chrom and install it on chrom, then on configuration debug
you need to choose run with javascript.
I can show you screenshot if you want
It is worth noting that you should have linked separate .js files for debugging. I was trying to debug JavaScript code which was within an .html file but the breakpoints were never hit. I looked later under the resources in Chrome Inspector and found out that the lines were not synchronized between the files, because for the debugger the first line was the first JavaScript line, but for the html file it was the first line of the file (DOCTYPE)

Problems opening javascript github examples

So I want to start using dc.js package to create a few dashboards, and I've found this tutorial:
https://github.com/austinlyons/dcjs-leaflet-untappd
I've downloaded the entire folder and attempted to open the html to see whether it works, but I only get some parts of the page (no data, no graphs, you can see the expected and gotten image attached). I've had the same problem with some other tutorials that I've found, and can't figure out why. I can open the page in the browser when it is a link like:
https://austinlyons.github.io/dcjs-leaflet-untappd/
Any ideas? I am using Chrome btw, but it doesn't work in IE either.
You need to run python -m SimpleHTTPServer in your terminal.
Try it yourself
If you want to play with the code as we go, I recommend downloading
the source code from this GitHub repository, navigating to the
directory where the files are located, and kicking off Python's
SimpleHTTP server so that you can see your visualization in your own
browser at http://localhost:8000 (If this is new for you, see this
link for a bit more information).
If anyone is interested there is a very nice workaround for those not willing to play around with a server. For some reason Firefox allows the opening of such pages, so one can test D3 and similar code in it without having to run a server.

Downlodify is not working, no error message at all

I have the latest shock wave (11.9.900.117) add-on installed to my Firefox (24).
When i download and run the sample test.html file nothing is happening.But when i run the same demo linked (http://pixelgraphics.us/downloadify/test.html) HTML from Git hub works as expected.
Also i have tried this with my project too, same kind of output, nothing happens but the button hides.There are no error messages shown or can be caught since i cant go through the swfobject.js file.
I am using javascript alone, not jquery etc.
Is there anything that i am missing some basic stuffs?
Also asked in https://github.com/dcneiner/Downloadify/issues/34.
Any simple working examples would be helpfull.!!
Thanks in advance.
I know this question is old, but for anyone who encounters the same problem, here is how I solved it.
If you want to run Downlodify from the local filesystem you need to edit the Flash Player Global Security Settings and add the Downlodify folder as a trusted location.
Currently the settings can be edited here. The location URI looks like this file:///C:/Users/Name/Desktop/Downloadify-master

Couldn't find 'aapt' tool! You may need to update your Android SDK, including platform tools

I am developing mobile application using trigger.io tool. While running the application in the triggerio plat form it giving error as couldn't find "aapt.exe" tool. It was suggesting to update android sdk. I updated android sdk and plat form tools yet the same error displaying. Please suggest need ful. Any help would be appreciate. Thanks in Advance.
got the same issue, solved it by changing "platform_version": "v1.4.47" in config.json
So again from what I can tell this is a problem with the python script that calls aapt.
When you look at the script it points only to aapt, this means its looking for a directory and not the aapt.exe file itself so the first thing that happens is
1) forge says it cant find the aapt directory, this is why you are getting the error message "cant find aapt tool"
2) by adding the directory you would get the access denied because then the script is trying to run all these commands on just the directory (this was the problem I ran into), by making the change below you do not need to create a directory, just leave everything how it is but add the exe and it should work
After doing some testing I found that by adding .exe to the pythong script in android_tasks.py the build was able to run successfully
if you look on line 35 of android_tasks.py and change 'appt' to 'appt.exe' it should build for you
this is what it looks like for me
path.join(sdk, 'build-tools', '*','aapt.exe')
Hope this helps
We made a change to fix this issue in our v1.4.49 platform version:
https://trigger.io/docs/current/api/release_notes.html

Categories