You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just started to play with nodegit, but I cant use it at all. Calling Repository.init command will die silently (no console output).
"Cannot find module './blame_hunk'"
Inspecting the app shows that its die while trying to load the modules in nodegit/dist/nodegit.js like the blame_hunk module. For different calls I get different errors.
Running this will throw an error in module.js:442 "Cannot find module './annotated_commit'" Going down in the stack trace I can see the issue is require is called from nodegit/dist/nodegit.js:746 when this line is called: importExtension("annotated_commit");
Hmm, just rerun this test case, and it still throw exceptions under the hood. ("Cannot find module './annotated_commit'") I am not sure tho if this is expected (and handled) or not. After running this test snippet a git repo is initialized but the file is not added to the index, its untracked.
Other people with similar issues are seeing this kind of thing fixed in latest. Closing this, if it's still broken for you, let us know and we'll reopen
Sorry for dragging up an old thread, but is it expected that some internal extensions are missing?
I can build via postinstall just fine, but looking at the source an importExtension("annotated_commit"); call is made to require the file annotated_commit. I don't have this file, but the exception is swallowed in a try/catch statement. Should I have it? If not, why include it, and if so, where's my file and why is the exception swallowed?
Building for electron if it makes a difference. I also miss things like nodegit.Reset.TYPE - it doesn't exist on that type. (using electron remote require)
@ashleydw The extensions that are "provided" are listed in the lib/ folder. I don't know if I'd really call them "extensions" but anyway, they're all in there. If one doesn't exist, that's perfectly normal. Not every wrapped API has extra pure JavaScript code added to it.
As to your second problem, I don't really understand what is going on. Perhaps you could provide some additional information like code and error messages and so on and so forth?
OK, now I understand regarding extensions. I see in the generator that there is no check regarding if they should exist and it adds all - hence the try/catch and swallow of the exception (
Edit: By adding console.log's throughout the code, I can see the extensions do get loaded in the initial load but not via electron's remote require. I guess my problem is there :/
Activity
NoNameProvided commentedon May 30, 2016
SImple example app demonstrating the issue:
Running this will throw an error in module.js:442
"Cannot find module './annotated_commit'"Going down in the stack trace I can see the issue is require is called fromnodegit/dist/nodegit.js:746when this line is called:importExtension("annotated_commit");[-]Cant use nodegit[/-][+]Latest Nodegit build is broken[/+]gjtorikian commentedon Jun 5, 2016
NodeGit 0.13.1 needs to be placed onto npm: bdf9c68
The core issue was fixed: #1026
/cc @johnhaley81
johnhaley81 commentedon Jun 5, 2016
Whoops... thanks @gjtorikian. I'm publishing now.
gjtorikian commentedon Jun 5, 2016
Thanks for the quick reply! 😻
johnhaley81 commentedon Jun 8, 2016
@NoNameProvided is this fixed for you now?
NoNameProvided commentedon Jun 12, 2016
Hmm, just rerun this test case, and it still throw exceptions under the hood. (
"Cannot find module './annotated_commit'") I am not sure tho if this is expected (and handled) or not. After running this test snippet a git repo is initialized but the file is not added to the index, its untracked.johnhaley81 commentedon Jun 23, 2016
@NoNameProvided I just published NodeGit 0.14.0. Can you see if that fixes this issue for you?
maxkorp commentedon Jul 13, 2016
Other people with similar issues are seeing this kind of thing fixed in latest. Closing this, if it's still broken for you, let us know and we'll reopen
ashleydw commentedon Mar 6, 2017
Sorry for dragging up an old thread, but is it expected that some internal extensions are missing?
I can build via postinstall just fine, but looking at the source an
importExtension("annotated_commit");call is made to require the file annotated_commit. I don't have this file, but the exception is swallowed in a try/catch statement. Should I have it? If not, why include it, and if so, where's my file and why is the exception swallowed?Building for electron if it makes a difference. I also miss things like
nodegit.Reset.TYPE- it doesn't exist on that type. (using electronremoterequire)rcjsuen commentedon Mar 9, 2017
@ashleydw The extensions that are "provided" are listed in the
lib/folder. I don't know if I'd really call them "extensions" but anyway, they're all in there. If one doesn't exist, that's perfectly normal. Not every wrapped API has extra pure JavaScript code added to it.As to your second problem, I don't really understand what is going on. Perhaps you could provide some additional information like code and error messages and so on and so forth?
ashleydw commentedon Mar 14, 2017
OK, now I understand regarding extensions. I see in the generator that there is no check regarding if they should exist and it adds all - hence the try/catch and swallow of the exception (
nodegit/generate/templates/templates/nodegit.js
Line 66 in 4a93dbf
Regarding my second part, in electron:
Results in
So it seems the extensions (https://github.com/nodegit/nodegit/blob/97ff2cdde471659bb158400c757815e4d48ba2ff/lib/reset.js) aren't being added to my object; they are being swallowed in the try/catch in the generator.
Edit: By adding console.log's throughout the code, I can see the extensions do get loaded in the initial load but not via electron's remote require. I guess my problem is there :/