google / santa-tracker-web

The source code to Santa Tracker's website, by Google
https://santatracker.google.com
Other
610 stars 155 forks source link

Closure files not working #35

Open SneezingCactus opened 3 years ago

SneezingCactus commented 3 years ago

I'm trying to run Santa Tracker on my Windows 10 computer. I've fixed some errors, and everything's working except for the closure.js files on each scene, so I can't fully access scenes. Other virtual files work fine. Closure files just give 404 errors with no other logs. I tried to fix it with no success. Any idea of why does this happen?

(Sorry for all the edits, I thought config.json wasn't working but then I checked again and it did work, that's why I edited the title 3 times)

samthor commented 3 years ago

Is there any chance you can send us a fix for the other issues? Having the site work even without Closure on Windows would be a great start—there's only a handful of scenes which still use that.

My 2c, I wonder if we pass specific /'s into the Closure compiler that Windows doesn't like.

SneezingCactus commented 3 years ago

I'll try to find and send the fixes (I don't remember what did I edit to fix it đŸ˜…)

SneezingCactus commented 3 years ago

So, what I first did was add .posix to the require("path") in import-utils.js to fix the "unsupported on Windows" problem. I also added the .posix in modern-vfs-middleware.js to fix most virtual files (like config.json) not working. The last thing I did was removing the /st/ prefix on static paths to fix certain static js files (such as santa-error.js) going way too back and going outside /st/ in some requires, causing those required js files to not be loaded. (I'm pretty sure there's a much nicer workaround to this though)

Hope this helps!

SneezingCactus commented 3 years ago

Also, for some reason, the 4 background village svg layers you'd see at the start of the page are missing.

SneezingCactus commented 3 years ago

I fixed it! There were two problems: Problem #1 is that santa-vfs, closure-compiler and closure-compiler-js make changes in paths, and since Windows uses \ instead of /, it breaks, so I added .posix to each require("path"). Problem #2 is that closurePlugin in santa-vfs gets the scene name and flags by the wrong m index (it uses m[1] and m[2] where it should be m[2] and m[3]), so I corrected it.

samthor commented 3 years ago

@SneezingCactus can you send a PR to fix this?

SneezingCactus commented 3 years ago

I would, but the problem is that in order to fix closure I'd have to modify closure-compiler and closure-compiler-js which are part of the google closure module, and I can't edit that (unless I can send a PR to the google closure repo)

SneezingCactus commented 3 years ago

I can send a PR for the other fixes though

samthor commented 3 years ago

I'm one of the original authors of closure-compiler-js so I can probably help with that. :) Although I think we are using the binary version now.

Having the non-Closure scenes work on Windows would still be great.

On Wed, 2 Dec 2020 at 16:19, SneezingCactus notifications@github.com wrote:

I can send a PR for the other fixes though

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/google/santa-tracker-web/issues/35#issuecomment-736997181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5DEHE3DK7NZQ4EVVLVRLSSXE6TANCNFSM4UGWGJ2A .

SneezingCactus commented 3 years ago

Ok, I sent the PR