Renaming root folder in Three.JS project causes weird aliasing bug - javascript

I hate to be the guy who makes a stackoverflow account just to ask a question (I owe a lot to stackoverflow), but this really has me utterly stumped.
For months I've been plagued with a mysterious bug that causes a bizarre rendering error in my three.js VR projects when running on Android.
I've always been able to solve it by basically rebuilding everything from scratch virtually line-by-line to see what causes the problem. I've never had any luck pinpointing the cause however.
Today, I found a way to reproduce the problem - I took google's Google Cardboard three.js example (which you can find at vr.chromeexperiments.com (I'm not allowed more than two links until I get my 10 reputation)), added in some spheres (so that there was something to watch for in regards to the aliasing) and found that it was running fine.
Renaming the root folder from 'WTF' (can you tell this is frustrating me? :P)to 'WTFF' will result in the rendering error appearing. Copying the folder, renaming the original 'WTFF' and naming the copy 'WTF' will result in the original displaying the rendering error, and the copy displaying correctly. That is, the error is caused by the project's root folder not having the name it had when the project was first created. I'm editing everything in notepad++.
Am I missing something here? The only files here are plaintext .js and .html, and a few images. Why does the root folder's name have any influence at all on how WebGL content is rendered? Is there some way around this error? Does anybody know what's causing it? I'm pretty familiar with three.js, but I've never done anything directly in WebGL, so there might be something under the hood that I'm not aware of perhaps that involves the folder structure?
I didn't include any code since the problem doesn't seem to have anything to do with the actual code within the file (this problem has cropped up in every three.js project I've worked on). But let me know if you think it might help.
Thanks so much in advance! :)
Update: I went away for half an hour and came back - now the original WTF-named folder structure is also displaying the error. I'm forcing a reload with window.location.reload(true);, so I have absolutely no idea what is going on anymore.

So I think I may have found the solution:
While I'm not sure of the exact underlying causes, it seems the problem lies within Chrome for Android, and not within WebGL or Three.js.
It seems that Chrome for Android is caching the WebGL content and doing something with it that causes this error to crop up if the folder structure changes.
The problem can be fixed by clearing the Chrome cache (Settings -> Application Manager -> Chrome -> Clear Cache).
I hope this helps anyone who encounters this problem in the future!

Related

Combine vis-network and vis-timeline on same page

I'm trying to use the network and timeline package on the same page (like I did when using the old 4.21 version, and it works there), but I can't get it to work. It's throwing an error (dataset or array expected), when I provide the vis-datasets to the network. If I remove the load of the js for the timeline in the header, it works - but then I don't have a timeline.
So it looks like loading the package for the timeline is interfering with the vis-datasets definitions.
Any idea what's wrong here?
Just found out that I need to use the DIST from vis-charts to have this working.
Just to clarify this is a known bug we're actively working to solve. It will work as you'd expect eventually. See https://github.com/visjs/vis-network/pull/85 for more information. In the mean time as you found out yourself use vis-charts.

NextJS - when I make a change in my project's file, a strange "cache/typescript/2.9/node_modules/#types/react'" appear on my imports

All is in the title. I'm working in NextJS. When I make a change in the organization of my project's file, a strange message
".cache/typescript/2.9/node_modules/#types/react'"
appears on my imports, specifically my Reactjs's imports. I have tried to retrace the problem by Googling but I have found nothing helpful. Does anyone know what that means? Any hint would be great.
That was simply a fail with some version of VSCode, after having realized an update to the latest version it works well now.

Why does Netbeans navigator pane not populate javascript files with specific filenames?

While I admit this is a pretty obscure problem, I'm posting this partly in case it is driving others crazy (too), partly because it might have wider ramifications, and partly because it may be an issue with my project settings.
In NB-8.1 I have several angular modules for handling a configuration-editing app. Since last week I have been trying to figure out why the navigator pane doesn't populate with these files. When I click on the source, the Navigator pane doesn't update. If the pane is newly opened, it shows <No view available>. If it is correctly showing another file, it remains showing the old file and effectively ignores the new file.
After experimenting, I found that it is specific to any js file with a filename prefix of "config" - which in this case was all the files for this particular app (config-service.js, config-ctrl.js, etc). Renaming the files with a new prefix (eg, "konfig-ctrl.js" or "x-config-ctrl.js") solved the issue.
Is this widespread, or a problem only with this project? If the latter, what should I look for? Help or advice appreciated.
This looks like a bug to me. AFAIK NetBeans is handling JS files with the config in name as possible Karma configurations and maybe it (although I can't remember if Karma has to be enabled or where exactly does it look for these candidate files...) I'd suggest to report a bug against NetBeans https://netbeans.org/bugzilla/enter_bug.cgi?product=web (component HTML Project)
I get a very similiar problem. Any js file with "conf" in the name (anywhere in the name) cannot be Run as javascript from Netbeans. Right-click on the file and Run is deactivated. Once I change the name to something else, it works.

Potential Git/Rails Disaster: Web page no longer loading

I have spent a lot of time working on a webpage and have been very lazy about committing things to Git. Today, I attempted to push everything up to my repo, but I think I may have caused a disaster. I am very new to Git and basically just use it for its most basic functions.
I was unable to push anything and the console recommended using a pull request, after doing that and attempting to push again, I began to get a bunch of merge conflicts with my gemfile and gemfile.lock. I tried fixing this issue as well but then I started seeing random <<<<<<HEAD throughout my files (including routes as well as my javascript).
Now when I try to load my localhost page, I seem to have all my content, but my css file will not load resulting in a very ugly page. When I use chrome devtools and try to look at the sources, the application.css.scss is blank, when mine have 1000+ lines of code (and is viewable in the app\assets\stylesheets folder.
Has anyone had something like this happen / know how to remedy the amount of damage I might've done in 15 min. Anything will help as I do not know how to proceed.
you'll want to try doing a git reset --hard to reset your local repo to the state it was at before you ran git pull.
see this answer for reference:
https://stackoverflow.com/a/1223385/3880374
also, in case you're curious about those "random" <<<<<<HEAD strings throughout your files, those are actually added by Git. Per their docs:
Git adds standard conflict-resolution markers to the files that have conflicts, so you can open them manually and resolve those conflicts
Github also has a helpful guide to resolving these conflicts via the command line.

Why is Node Express Duplicating Static Content

I have the following app.js file:
https://gist.github.com/manifestinteractive/393a4aae0c4ed4fb6bc2
When I look at files I am loading statically in the public folder via the operating system, they look correct, however, if I go to view them via the browser as intended for delivery through node express engine, the contents are duplicated. Basically, it is taking the file and appending it to itself, which of course breaks the javascript.
Anyone know why this would be happening? Suck a weird bug and I can't for the life of me put my finger on the cause.
For the record, I have tried looking everywhere for a solution. I've just not seen anyone talk about it. A quick test shows that I can manually change the JavaScript file at the source, and refresh the code in the browser, and it will reflect the changes correctly, but it will still be displayed twice.
Thought it might be some weird issue where maybe I had multiple instances of Node running or something, as that MIGHT explain it... but nothing :(
If I find what it is, I will follow up with the issue immediately, but for the time being, I am likely just doing something stupid someone here might yell at me for... and I would gladly welcome it :)

Categories

Resources