-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Yarn.Compiler installed from NuGet crashes on CompileFile #250
Comments
Can you provide the Yarn file you were using? |
Sorry for the nonsense
|
Thank you! Will investigate. |
Unity is known to have problems importing the .dll of nuget packages installed through visual studio - you have to manually add the .dll to unity |
Well, I'm not using Unity |
Can confirm on the same scenario that @mgilski mentioned. My dialog:
Exception:
|
I'm not able to reproduce this issue in |
I've tracked down the "source" of this crash, and would suggest re-opening it and fixing it. I checked out the YarnSpinner build that's currently on Nuget using a decompiler, and it looks like the issue lies with this line of code in YarnSpinnerLexer. Basically, this line compiles out to using On some platforms/.NET versions, it seems like the context of the function itself using Antlr4's Tuple is enough to inform the runtime to use that type rather than In theory, a simple fix could just be to explicitly state that the Tuple type used/created there is Antlr4's Tuple, which should inform any runtimes which type is actually being used, and thus eliminate any runtime-specific errors. I checked I'm confused as to how this compiles to that at all, honestly, because I'd expect the C# compiler would complain about passing in a EDIT : Looks like more recent versions of Antlr4 use System.Tuple, so an even easier fix could be to simply update the Antlr4 dependency for the Nuget package. |
I was experiencing this problem in YarnSpinner 1.2 and switched to YarnSpinner 2.0.0-beta0006 and the problem went away. The library's changed substantially for 2.0, but I managed to get it to compile a yarn file successfully without the missing method exception noted in the original report. |
Good to know! Glad to see it's fixed on 2.0 |
I spoke too soon, and ran into a Tuple exception once I introduced options to my 2.0 syntax yarnfile. When it only has nodes with simple lines, it compiles and runs properly. I'm refactoring my Godot project in a way which makes this easier to troubleshoot and will share more details soon. |
On newer target frameworks, such as 4.7.2 for Godot Mono projects, the issue occurs. If I clone this repo, change I'm forking the repo and will submit a PR with a fix for the develop branch (2.0 beta). |
Dependant projects targeting dot.net 4.7.2 and later have runtime errors due to Tuple mismatches between the dot.net SDK and the Antlr4 library, when using the package from nuget. If the compiler project is updated to target 4.7.2 then the runtime errors are caught during compilation. Updated the project to demonstrate the problem during build, and updated the code to pass the tests. Note: this is backwards incompatible, due to the change in the targeted framework.
Ugh never mind, when the library targets I don't have the time to dig into a solution for this and will look at other libraries instead for now, such as Ink. Here's a commit to a fork I made, demonstrating the problem with a fix. I didn't spin up a PR because it would be backwards incompatible, jumping all the way from 2.0 to 4.7.2, and would probably break a number of dependant projects. This should be reopened though, because dot.net 2.0 is no longer supported and projects targeting the newer frameworks are going to have a bad time. Myself, I'm moving on, and looking into other libs, such as Ink. |
Re-opening this issue; the community efforts to improve Godot support are running into this, and I want to keep this on my radar. Thanks to all who've helped identify so much about this problem! |
This is where I'm hitting this error in YarnSpinner-Godot
|
What is the current behavior?
Yarn installed from nuget crashes when trying to compile file.
Please provide the steps to reproduce, and if possible a minimal demo of the problem:
Install
Yarn.Compiler
from nuget and callCompiler.CompileFile
with a sampleyarn
file.Please tell us about your environment:
Other information
Got rid of the error by compiling
Yarn.Compiler
project from source.Error and stack trace:
The text was updated successfully, but these errors were encountered: