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

MissingMethodException? #2

Open
tedneward opened this issue May 26, 2019 · 2 comments
Open

MissingMethodException? #2

tedneward opened this issue May 26, 2019 · 2 comments

Comments

@tedneward
Copy link

tedneward commented May 26, 2019

Writing a simple VSMac Jint/Jint.CommonJS console app, and I'm running into a MissingMethodException being tossed from this code:

var cjs = engine.CommonJS();
cjs.RegisterInternalModule("console", typeof(Console));

This is with 3.0beta of Jint, if that makes a difference.

The exception looks like:

System.MissingMethodException: "Method not found: 'Jint.Native.JsValue Jint.Native.JsValue.op_Implicit(Jint.Native.Object.ObjectInstance)'."
  at Jint.CommonJS.ModuleLoadingEngine.RegisterInternalModule(String id, Type clrType)\n   at JintExplorer.Program.Main(String[] args) in /Users/tedneward/Projects/JintExplorer/JintExplorer/Program.cs:46

Any insights appreciated, particularly if this is a user bug. (Just started playing with Jint.CJS.)

@tylerjwatson
Copy link
Owner

Hi mate,

I believe this library was not compiled against Jint 3.0. I will look at supporting it when it comes out of beta. Alternatively you're more than welcome to submit a PR introducing support for Jint 3.0.

Cheers 👍

@olliejm
Copy link

olliejm commented Jan 23, 2020

I took a look at this and it seems it's just this line https://github.com/tylerjwatson/Jint.CommonJS/blob/master/Jint.CommonJS/Module.cs#L103

With Jint 3.0 it wants the second parameter to be a string 'name', then the Func as the third and last required parameter. Just passing fileName as that parameter allowed the project to build and all tests pass. But not sure if that's the value that should really go there.

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

3 participants