X Tutup
The Wayback Machine - https://web.archive.org/web/20200916183637/https://github.com/nodegit/nodegit/issues/1794
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

Cannot read property 'TYPE' of undefined #1794

Open
ArturKovacs opened this issue Sep 11, 2020 · 2 comments
Open

Cannot read property 'TYPE' of undefined #1794

ArturKovacs opened this issue Sep 11, 2020 · 2 comments

Comments

@ArturKovacs
Copy link

@ArturKovacs ArturKovacs commented Sep 11, 2020

System information

  • node version: v12.18.3
  • yarn version: 1.21.1
  • OS/version/architecture: Windows 10.0.19041 x64
  • Applicable nodegit version: nodegit@0.27.0

I'm using electron and I have the following in my main process

import * as Git from "nodegit";
console.log("Git version is:", Git.version);
console.log("The HARD reset type has the id", Git.Reset.TYPE.HARD);

When I yarn start as usual, I get the following output

Git version is: 0.27.0
App threw an error during load
TypeError: Cannot read property 'TYPE' of undefined
    at Object../src/main.ts ([redacted-project-dir]\.webpack\main\index.js:17543:57) 
    at __webpack_require__ ([redacted-project-dir]\.webpack\main\index.js:21:30)     
    at [redacted-project-dir]\.webpack\main\index.js:85:18
    at Object.<anonymous> ([redacted-project-dir]\.webpack\main\index.js:88:10)      
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)       
    at Module.load (internal/modules/cjs/loader.js:816:32)
    at Module._load (internal/modules/cjs/loader.js:728:14)
    at Module._load (electron/js2c/asar.js:717:26)
    at Function.Module._load (electron/js2c/asar.js:717:26)

Note that I get identical results when I do these in my renderer process using ipc.

@ArturKovacs
Copy link
Author

@ArturKovacs ArturKovacs commented Sep 11, 2020

I just realized that this is probably caused by the way my project is configured and I don't particularly like using the issue system for asking for help about usage so I created a stackoverflow post here: https://stackoverflow.com/questions/63844607/nodegit-cannot-read-property-type-of-undefined

Please consider helping me on stackoverflow. I'm closing this for now.

@ArturKovacs ArturKovacs reopened this Sep 15, 2020
@ArturKovacs
Copy link
Author

@ArturKovacs ArturKovacs commented Sep 15, 2020

The reason for reopening this issue is that this is also the behaviour I get when doing this in a fresh project created with

yarn create electron-app my-electron-webpack-typescript-nodegit --template=typescript-webpack

It might be relevant that I'm doing all this on Windows.

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.
X Tutup