Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closure files not working #35

Open
SneezingCactus opened this issue Nov 29, 2020 · 10 comments
Open

Closure files not working #35

SneezingCactus opened this issue Nov 29, 2020 · 10 comments
Labels

Comments

@SneezingCactus
Copy link

SneezingCactus commented Nov 29, 2020

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)

@SneezingCactus SneezingCactus changed the title Virtual files not working Closure files not working Nov 29, 2020
@SneezingCactus SneezingCactus changed the title Closure files not working Virtual files not working Nov 29, 2020
@SneezingCactus SneezingCactus changed the title Virtual files not working Closure files not working Nov 29, 2020
@samthor
Copy link
Contributor

samthor commented Nov 29, 2020

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
Copy link
Author

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

@SneezingCactus
Copy link
Author

SneezingCactus commented Nov 30, 2020

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
Copy link
Author

SneezingCactus commented Nov 30, 2020

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

@SneezingCactus
Copy link
Author

SneezingCactus commented Nov 30, 2020

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
Copy link
Contributor

samthor commented Dec 1, 2020

@SneezingCactus can you send a PR to fix this?

@samthor samthor reopened this Dec 1, 2020
@SneezingCactus
Copy link
Author

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
Copy link
Author

I can send a PR for the other fixes though

@samthor
Copy link
Contributor

samthor commented Dec 2, 2020 via email

@SneezingCactus
Copy link
Author

Ok, I sent the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants