Webgl UCB fails with Preprocessor error

Hi,

In the last few days, I am getting errors "…index.html failed with …throw ‘Preprocessor error when evaluating expression ReferenceError: ENVIRONMENT_VAR is not defined’ and the build is failing.

I am using PostProcessWebGL.PostExport() to edit index.html with some environmental variables (as per this post ).

It seems that the order of execution or an extra checking of index.html is happening.

I am using Unity 2021.3.19f1 and everything was working fine a few days ago.

Anyone else encounters this issue?

If you are still running into this issue please open up a support ticket through the Unity Dashboard.

Yes still happening:(
I have this ticket

I was able to fix this.
I moved the code (replacing the placeholders in index.html template - {{{ PLACEHOLDER }}}) from a Post-Export method to the Pre-Export method (in UCB).
I used PlayerSettings.SetTemplateCustomValue() instead of editing the index.html file directly.

2 Likes