Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2020.1
2020.2
2020.2.0a9
Issue ID
1253237
Regression
No
[WebGL] Javascript error is thrown when executing Func<Vector3> func = () => Vector3.zero; in build
How to reproduce:
1. Open user attached project "Bug Reproduce.zip"
2. Build and Run for WebGL
Expected result: No Error is thrown when the build starts playing
Actual result: Javascript error is thrown after the build starts playing
Reproducible with - 2018.4.25f1, 2019.4.4f1, 2020.1.0b16, 2020.2.0a18
Successfully reproduced on: Chrome, Firefox, Opera
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Shader transparency, discard, and clip are not working when using the Player
- Error is thrown when clicking on warning in the console
- Long IL2CPP build time when project has a .ufbx library wrapper
- Cursor doesn't change to the resizing when using the Rect Tool and the Sprite is too close to the bottom of the Scene View
- InvalidOperationException exception is thrown when Editor Default Text Rendering Mode is set to "Bitmap" and Editor Font is set to "System Font" and an array is expanded in the Inspector Window
Resolution Note (2020.2.X):
A quick stand-alone test showed there was nothing wrong with `Func<Vector3> func = () => Vector3.zero;`. The reason why the given example is crashing is because the "Test" component is on an object that's a child of the camera. GameManager. GameManager gets the Test component via `Test test = Camera.main.gameObject.GetComponent<Test>();`. This is not correct, it should be returning null. I moved the Test component onto the camera, and the example worked correctly. You can set "Enable Exceptions" to "Full" in the Player Settings under Publishing Settings, to get the NullReferenceException that would have revealed the problem.