New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No writer found error #2579
Comments
Had the same problem. But mine is a bit weirder, I'm using a readonly struct with strings and ints. And whenever I open the project again, it prints out the error, but everything happens like expected (?). Desktop. Linux (arch LTS), Standalone, 2020.2.5f1, v30.5.1 |
I have also encountered this issue since upgrading Unity and Mirror in my project recently. On my project it only seems to happen with structs that contain another struct. |
Same, few posts here about it. |
Never got this issue on 2020.1.17, but started getting it immediately after upgrading to 2020.2.6 |
For me "Weaver: stop because compile errors on target" was the issue. In Unity 2020.2 warnings suppressed by roslyn analyzers are somehow treated as errors. Possibly "Suppress common warnings" option added in all 2018+ editors since this post https://forum.unity.com/threads/suggesting-solutions-for-serializefield-warning.962112/page-2#post-6762493 triggers it. I recommend adding ERROR log to weaver to see what stops it.
Analyzers fix:
|
Seeing the same issue using the latest version of Mirror from the Unity Asset Store As with others if we right click on teh folder and select reimport to force it to recompile the issue goes away though returns every time we open the project and we suspect is also present in builds from Unity Cloud Build As a result this has our project stoped ... so we are going to try and revert to 30.5.1 to see if that helps ... belive Lange from Discord comunity said that helped them |
From what we can tell this happens on any non-primative thing that need serialize We had ran quite a while with these structures on an older version (dont recall specificly what version) ... point is we know the model we are working with did work and no longer does. It does work after you reimport ... until you restart the project. This however is not a sufficent workaround to the issue since we use cloud build and we cant very well reimport on the build server before we build. At the moment this is a show stoper e.g. has stoped the project outright. |
hey guys. on my phone right now but please share step by step guide on how I can reproduce it. will check it out today. |
back home. |
For me it seems to appear when i use sync lists: |
For us the common issue seems to be non-primative objects for example we have a structure (example only) [Serializable] That doesn't work, we get the reader errors rather its used in a SyncList, SyncVar or CMD/RPC we always get issues We have other SyncVar and Lists that are primative and get no errors/warnings about them When we reimport the Mirror folder the issue goes away On 2019 running an older version of Mirror (17.3.0) the same structures and code worked with no issue at all I have not tried to reproduce in a smaller project but if you need I can give it a go ... at the moment I am focused on trying to work around the issue as this does have us at a hard stop. |
I have tried, but I can't reproduce this issue in an empty project. It's strange. |
I'm getting the same error with Unity 2020.3 LTS and last Mirror version. I'm using ummorpg 2d remastered and I'm getting this error:
|
For us we had the issue on Unity 2020.2 and now on Unity 2020.3 In our case when we first open the project the issue is present, then we can right click on the Mirror folder and reimport and the issue is resolved. The problem as noted in our case is that our cloud builds cant do that second import on the Mirror folder so that little work around is okay for client only cases does nothing for conditions on the server that present this issue. Its interesting that causing a recompile sorts the problem and that the problem seems to be built around structs .... that is SyncList and similar where its primatives that are being usesd are never noted its always some serializable struct that is called out as not having a writer. |
from discord: Note what we did ... think this may be some pain in the arse from Collab so
what we think was the issue |
tried 2020.3 again today. |
quick update: I am working on a fix. the bug was introduced in the weaver several months ago. |
for reference, here is the commit that started it: from discord: both 2019 and 2020 add the generated writers. |
gotta head out soon. to summarize, there are two issues:
|
pushed a fix to master to guarantee that [InitializeOnLoad] is always called in Editor. not sure if anyone encountered 'no writer found' at runtime though. (simply download mirror master from github) |
reading through it again, it sounds like you all encountered the error in the editor. |
for the above repro:
|
To everyone following this ticket, please try master branch as soon as possible to confirm we have this fixed, and come to Discord and tell us if not. Thanks! |
Just loaded up v35.1.0 and so far so good, Writer error is gone! Not having to edit/save/reload any script to force a reload. Everything appears to be working, thanks guys. |
Thank you guys. Can confirm. No more Writer errors <3 |
Describe the bug
I get the "No writer found for PlayerStats. Use a type supported by Mirror or define a custom writer" error when calling a ClientRpc method.
Reimport or edit script to trigger the compile process can solve this issue, but it will appear again after restart Unity.
The method is:
[ClientRpc]
void RpcSyncPlayerStats(PlayerStats[] _playerStatsArray)
PlayerStats is a class, and each field has a supported data type.
To Reproduce
Every time run the game after restart Unity, but I can't reproduce it in an empty project.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: