Open nsdod opened 3 months ago
Update! I have more information on what's going on here.
So, the iframe generated by the Unity Widget (I think) is trying to access the UnityLibrary directory from a parent directory that does not exist in the build. In particular, the page with the Unity widget on it is navigated to from a page called 'modEdit' via a button press. The iframe that's meant to have the Unity app in it looks like this:
But no such directory/file http://localhost:55405/modEdit/UnityLibrary/main.dart.js
exists. I'm not sure why the iframe is pointed to this location when it should be looking in the root directory of the app. Does anyone have any ideas on what's causing this or how to correct it? Any additional information needed?
Does it make a difference if you use the previous version of the plugin (2022.2.0) ? 2022.2.1 included a PR to allow unity to work when Flutter is not at the root of the domain, see the change here.
I believe that is also the only location in the plugin where a web directory is defined.
If this doesn't help, maybe try creating a small reproduction project that triggers this, which uses as few other plugins as possible.
Hi! I'm seeing an issue where the Unity Flutter widget doesn't load properly when navigated to from another page (WebGL). The error log appears as follows:
The error references a MIME type issue that, from previous reports, appear to usually be caused by selecting the GZIP compression format. However, this Unity project is built to WEBGL with the compression formatting disabled (and changing it to Brotli doesn't fix the issue). The UnityLibrary assets appear to be in the correct place after exporting.
The 'modEdit' reference as seen in this error is the previous page from which the Unity widget's page is navigated to. Could this have something to do with how the iframe used to contain the Unity application loads into the widget, or a strange interaction with the Navigation stack? The base application is made with Flutterflow. However, the Unity Flutter widget is added to the project manually, after exporting the project to into Dart/Flutter code. Lottie animations are in use for page transitions.
Browser: Google Chrome 126.0.6478.127 Unity version: 2022.3.27f1 Flutter: 3.22.2 Dart: 3.4.3