-
Notifications
You must be signed in to change notification settings - Fork 41
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
Uncaught Error: "refId" not found: 31 #128
Comments
Sadly i can't share my repo right now since it's a work project and the company isn't mine. |
@naive17 I'm having similar problems after switching the frontend bundler to use esbuild while the backend still uses typescript. could you tell us about your build stack? (my very wild guess is that the schema classes are loaded in a different order) |
Hi! |
yeah, vite uses esbuild. |
But i'm not having that problem so frequently now |
For future reference, pre-bundling the common code worked for me: It prevented the browser bundler from re-arranging the schema files, thus kept the loading order in sync between server and client. @endel I would add a warning to the limitations and best practices documentation : The order of the classes must be the same, meaning that any difference in build tools between client and server that may affect the loading order of the schema files may cause |
@naive17 I suspect there is some kind of concurrency race condition in your build job? so that sometimes the same order is kept between client and server, and sometimes not? |
Interesting, thanks for inspecting and finding this out @amir-arad! |
What is the resolution? Hitting this issue when using very very basic state...
MyState has some getters as well but I don't believe they cause this error |
What does |
Hi @RaiaN, can you please provide a small reproduction scenario? This issue hasn't been easily reproducible for me. The "The order of the fields must be the same" generally applies to compiled targets, where |
@endel I am not sure how to repro it. I shuffled the fields again and removed some of the logic from Schema class and the error is gone.. Weird. My feeling is that actively changing order of the fields while restarting server and client leads to the issue like that. Another thing is recursive structures / schemas. Not sure how well those are supported. |
Hi i'm using colyseus since a bit but now i'm getting this weird error.
As i remove anything from a state that uses ArrayMap on Leave, on the next join all the connected players will receive this error.
The text was updated successfully, but these errors were encountered: