Skip to content
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

Unity 6 - JSException: [JS] undefined:undefined System.Reflection.TargetParameterCountException: Number of parameters specified does not match the expected number #126

Open
localhosted opened this issue Feb 12, 2025 · 0 comments

Comments

@localhosted
Copy link

Added the package to Unity and created the react js project but it won't run. Fails with:

JSException: [JS] undefined:undefined System.Reflection.TargetParameterCountException: Number of parameters specified does not match the expected number.
at System.Reflection.RuntimeMethodInfo.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) [0x00016] in <321eb2db7c6d43ea8fc39b54eaca3452>:0
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00040] in <321eb2db7c6d43ea8fc39b54eaca3452>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <321eb2db7c6d43ea8fc39b54eaca3452>:0
at QuickJS.Binding.DynamicDelegateMethod.Invoke (QuickJS.Native.JSContext ctx, QuickJS.Native.JSValue this_obj, System.Int32 argc, QuickJS.Native.JSValue[] argv) [0x00070] in .\Library\PackageCache\com.reactunity.quickjs\Runtime\Source\Binding\DynamicMethod.cs:432
at QuickJS.Utils.TypeDB._DynamicMethodInvoke (QuickJS.Native.JSContext ctx, QuickJS.Native.JSValue this_obj, System.Int32 argc, QuickJS.Native.JSValue[] argv, System.Int32 magic) [0x00022] in .\Library\PackageCache\com.reactunity.quickjs\Runtime\Source\Utils\TypeDB.cs:428
at b__1 (native)
at ./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=3000&pathname=%2Fws&logging=none&overlay=false&reconnect=10&hot=true&live-reload=true (ReactUnity/main:31524)
at call (native)
at (ReactUnity/main:36301)
at call (native)
at webpack_require (ReactUnity/main:35752)
at (ReactUnity/main:36881)
at (ReactUnity/main:36885)

QuickJS.ScriptContext.EvalSource (System.Byte[] source, System.String fileName, System.Type returnType) (at ./Library/PackageCache/com.reactunity.quickjs/Runtime/Source/ScriptContext.cs:858)
QuickJS.ScriptContext.EvalSource[T] (System.String source, System.String fileName) (at ./Library/PackageCache/com.reactunity.quickjs/Runtime/Source/ScriptContext.cs:833)
ReactUnity.Scripting.QuickJSEngine.Evaluate (System.String code, System.String fileName) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:121)
ReactUnity.Scripting.QuickJSEngine.Execute (System.String code, System.String fileName, ReactUnity.Scripting.JavascriptDocumentType documentType) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:129)
ReactUnity.Scripting.QuickJSEngine.TryExecute (System.String code, System.String fileName, ReactUnity.Scripting.JavascriptDocumentType documentType) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:136)
UnityEngine.Debug:LogException(Exception)
ReactUnity.Scripting.QuickJSEngine:TryExecute(String, String, JavascriptDocumentType) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:140)
ReactUnity.Scripting.<>c__DisplayClass37_0:b__0() (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/ScriptContext.cs:62)
ReactUnity.Scripting.<>c__DisplayClass38_0:b__0() (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/ScriptContext.cs:117)
ReactUnity.Scripting.<>c__DisplayClass44_0:b__0(IJavaScriptEngine) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/ScriptContext.cs:168)
ReactUnity.Scripting.QuickJSEngine:Runtime_OnInitialized(ScriptRuntime) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:116)
QuickJS.ScriptRuntime:RaiseDebuggerConnectedEvent() (at ./Library/PackageCache/com.reactunity.quickjs/Runtime/Source/ScriptRuntime.cs:456)
QuickJS.ScriptRuntime:Initialize(ScriptRuntimeArgs) (at ./Library/PackageCache/com.reactunity.quickjs/Runtime/Source/ScriptRuntime.cs:441)
ReactUnity.Scripting.QuickJSEngine:.ctor(ReactContext, Boolean, Boolean, Action1) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:66) ReactUnity.Scripting.QuickJSEngineFactory:Create(ReactContext, Boolean, Boolean, Action1) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/QuickJS/QuickJSEngine.cs:274)
ReactUnity.Scripting.ScriptContext:CreateBaseEngine(Boolean, Boolean, Action) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/ScriptContext.cs:158)
ReactUnity.Scripting.ScriptContext:Initialize(Action) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/ScriptContext.cs:78)
ReactUnity.Scripting.ScriptContext:RunMainScript(String, Action, Action) (at ./Library/PackageCache/com.reactunity.core/Runtime/Scripting/ScriptContext.cs:51)
ReactUnity.<>c__DisplayClass90_1:b__0(String) (at ./Library/PackageCache/com.reactunity.core/Runtime/Core/ReactContext.cs:221)
ReactUnity.d__30:MoveNext() (at ./Library/PackageCache/com.reactunity.core/Runtime/Core/ScriptSource.cs:300)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant