Skip to content

wasm file downloads twice #531

Open
Open
@MarkZamoyta

Description

@MarkZamoyta

Please avoid duplicates

Language and Compiler

TypeScript's built-in Compiler

What environment are you using?

Local Development Server

When does your problem occur?

When the Unity Component mounts

What does your problem relate to?

The problem seems Unity related

React-Unity-WebGL Version

9.4.3

React Version

17.0.2

Unity Version

2021.3.16f1

What happened?

My game downloads but gets stuck for 25 seconds at 90%. I looked at what was going on during that time, and the browser is downloading the wasm file twice. On a chromebook with limited resources, it doesn't get cached (ever), so this doubles the download time. On a PC, everything is fine because the wasm file is cached after the first download, and the 2nd download is near instant.
Is there a way to prevent it being downloaded twice? It happens somewhere in useUnityContext() before it sets isLoaded to true.

Reproducible test case

No response

Would you be interested in contributing a fix?

  • yes, I would like to contribute a fix

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions