Deployed MZ Game Fails to Run

The following was the error that I received

Failed to execute 'getUniformLocation' on 'WebGL2RenderingContext': parameter 1 is not of type 'WebGLProgram'

EDIT: Changed the title from "MZ Failed to Playtest after it's been deployed" to "Deployed MZ Games Fails to Run"
Please clarify. You're saying that after you deploy a project, you start getting an error when you click the playtest button in the editor?

Or you're saying you get a crash when you try to run the deployed game (which is not a playtest)?

Please give an actual screenshot of the error screen.
Ah I worded incorrectly. Not playtest, I deployed a game, and then tried to run it but it crashes.
hang on a sec, I'll fix the thread title real quick
It plays fine on playtest but gives out an error like this on deployment?
It plays fine on playtest but gives out an error like this on deployment?
Yes. When I playtest it, it can run. However, after I deployed it, the game crashes on startup and fails to run
which deployment type?
where is it stored at the moment of the error (full folderpath from drive letter if on PC)
have you tested the deployed game on multiple computers?
When you deploy, are you checking the Exclude unused files box? If you have plugins in your project, they may have dependencies that aren't properly registered; so checking that box can cause your project to not include files the plugins need.
@ATT_Turan Ohh, I see, like that, okay I'm going to try it out

@Andar In Documents -> Output
@Andar In Documents -> Output
What does that mean? My MZ does not have a Documents menu.

It might be a translation thing - yes, you select File -> Deployment. But Andar was asking what type of deployment:
1690812386319.png
I deployed on Windows only
In Documents -> Output
(full folderpath from drive letter if on PC)
I asked for the full folderpath beginning with the drive letter.
"Documents" or "This PC" are shortcuts that hide the true folderpath and are useless for what I asked.

right-click on the index.html, select properties and then check the location (or however that property is called in your language)
Also the reason the full filename is asked for is MZ games cannot run if there are certain characters in the game name or the directories containing it. Playtest will cheat and ignore that, but once you deploy it has to follow full networking rules. Which means for starters, no spaces in any directory or the game name (though occasionally you can get lucky and it will run still as your OS cheated to get around it but its honestly not supposed to).
If you turn OFF all plugins in your plugin manager; save the project; deploy again, does it run?

This doesn't read like an error related to trying to read a file with an incorrect letter in the path; but that's the typical reason for something that works in playtest but not when deployed. So it's weird.
It looks like it's failing to compile a shader? My guess would also be a plugin.

[Edit: perhaps related to the "exclude unused files" deployment option.]
Right. Are you using exclude Unused files? If so, don't. That command cannot tell if a file is used in a plugin unless they used a very specific setup in the plugins and most plugin authors said they were not going to do that due to other issues it caused. Soooo...best to manually remove unused files and not check that box as well.
@ATT_Turan I tried that, but no avail

@Andar C:\Users\60149\Documents\Output\VisuMZ_Sample_Game_Project

@bgillisp "Also the reason the full filename is asked for is MZ games cannot run if there are certain characters in the game name or the directories containing it." Could you explain lil bit more, I doesnt know what you mean

@caethyril Shader? Do I have to update something anything at my end?

Sorry I forgot to mention. The only plugins I am using are VisuStella Sample Game
Could you explain lil bit more, I doesnt know what you mean
RMMZ creates HTML5-based games, and as such they have to obey the rules for networks and HTML.
If you had a symbol or letter in the path that is forbidden for networks but alklowed for Windows, then that will cause problems with running the game - and you are not allowed to use spaces in webadresses for example, but there are also other limits there.

The EDITOR forces the playtest by redirecting the playtest into a virtual folder that follows the HTML-rules, but the game itself has to use the true file and foldernames.

Whichg basically means that is one of the errors that blocks the game but is ignored by the playtest.
Just to super confirm - if you make a brand new test project, do nothing to it, deploy it. Does it work or produce the same issue?

If yes, I'd be inclined to thing it's an operating system issue, some setting preventing the browser from accessing your graphics...driver? Stuff?
Hi @ATT_Turan @Andar @bgillisp @caethyril @YeXin
An update. So I was about to give up on game making right, I decided to blow them all of my progress including RPG Maker. I reset my laptop. But the spirit of fairness whispers into me to say, you know what, youve gone so far so as to delete everything, why not poke a lil bit at it once more see if it works.
so after I reset my laptop, threw everything away, I redownloaded Steam, and woops! RPG Maker MZ now works. Idk what happened really, as I did try everything you all suggested. But thanks the spirits it now works, and though I might have gone too far, I at least can really say that I'm turning over a new leaf 🙂

you know what, lemme try that visustella sample game if it works

aaannnnnd it works. thanks fairness
This thread is being closed due to being solved. If you need it reopened, report it to lest us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/deployed-mz-game-fails-to-run.159882/