NAPI_MODULE Causing CrashJasmine spies only detect calls on methods called on Node.js exports objectClarification on exception handling in C++/CLI in mixed native/managed scenariosMocking a module function which is exported and called within the same module?fs module fails when integrating Electron into Angular projectElectron app performance: blocking thread with ipcRenderer.sendSyncHow can I use functions and objects without require them in NodeJSAccess Electron API from a completely different system processIs there any difference between Electron built-in module and the one installed with npm? How to access to the electron object from other modules?Electron i32 app cant find sqlite3 moduleN-API C++ addon causing Electron GUI to block

To find islands of 1 and 0 in matrix

What is the reason for cards stating "Until end of turn, you don't lose this mana as steps and phases end"?

How to improve king safety

My employer is refusing to give me the pay that was advertised after an internal job move

Problem with Eigenvectors

Piece of chess engine, which accomplishes move generation

What is a good example for artistic ND filter applications?

Why is it "on the inside" and not "in the inside"?

Anti-cheating: should there be a limit to a number of toilet breaks per game per player?

Why did Windows 95 crash the whole system but newer Windows only crashed programs?

What do I do with a party that is much stronger than their level?

Why is it considered acid rain with pH <5.6?

Is there a word to describe someone who is, or the state of being, content with hanging around others without interacting with them?

How to season a character?

Why does the Eurostar not show youth pricing?

Should I accept an invitation to give a talk from someone who might review my proposal?

Should I intervene when a colleague in a different department makes students run laps as part of their grade?

Filter search results by multiple filters in one operation

Is it okay for me to decline a project on ethical grounds?

Connection Between Liver & Honor?

How did "ordnance" lose the "i"?

Why does aggregate initialization not work anymore since C++20 if a constructor is explicitly defaulted or deleted?

What is the German equivalent of the proverb 水清ければ魚棲まず (if the water is clear, fish won't live there)?

What clothes would flying-people wear?



NAPI_MODULE Causing Crash


Jasmine spies only detect calls on methods called on Node.js exports objectClarification on exception handling in C++/CLI in mixed native/managed scenariosMocking a module function which is exported and called within the same module?fs module fails when integrating Electron into Angular projectElectron app performance: blocking thread with ipcRenderer.sendSyncHow can I use functions and objects without require them in NodeJSAccess Electron API from a completely different system processIs there any difference between Electron built-in module and the one installed with npm? How to access to the electron object from other modules?Electron i32 app cant find sqlite3 moduleN-API C++ addon causing Electron GUI to block






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am working on a c++ native module within electron that formerly used v8 methods to register methods. I have been converting this code to use N-API calls. Here is a snippet of code from this module:



static napi_value initialise(napi_env env, napi_value exports)

napi_status rcd;
napi_value fn;

try

rcd = napi_create_function(env, 0, 0, do_about, 0, &fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to create about");
rcd = napi_set_named_property(env, exports, "about", fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to register about");

catch(std::exception &e)
napi_throw_error(env, 0, e.what());
return exports;
// initialise

NAPI_MODULE(NODE_GYP_MODULE_NAME, initialise)


When I try to load this within the electron main process, I am getting an access violation in the expansion of the NAPI_MODULE macro. I have attempted to debug this by having visual studio attach to the three electron processes before require statement for my native module. I have verified that the initialise() function is not being called but there is an access violation.



Is this something that others have encountered?










share|improve this question
























  • Maybe sharing the access violation stack trace would be helpful.

    – bmacnaughton
    Mar 29 at 12:11

















0















I am working on a c++ native module within electron that formerly used v8 methods to register methods. I have been converting this code to use N-API calls. Here is a snippet of code from this module:



static napi_value initialise(napi_env env, napi_value exports)

napi_status rcd;
napi_value fn;

try

rcd = napi_create_function(env, 0, 0, do_about, 0, &fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to create about");
rcd = napi_set_named_property(env, exports, "about", fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to register about");

catch(std::exception &e)
napi_throw_error(env, 0, e.what());
return exports;
// initialise

NAPI_MODULE(NODE_GYP_MODULE_NAME, initialise)


When I try to load this within the electron main process, I am getting an access violation in the expansion of the NAPI_MODULE macro. I have attempted to debug this by having visual studio attach to the three electron processes before require statement for my native module. I have verified that the initialise() function is not being called but there is an access violation.



Is this something that others have encountered?










share|improve this question
























  • Maybe sharing the access violation stack trace would be helpful.

    – bmacnaughton
    Mar 29 at 12:11













0












0








0








I am working on a c++ native module within electron that formerly used v8 methods to register methods. I have been converting this code to use N-API calls. Here is a snippet of code from this module:



static napi_value initialise(napi_env env, napi_value exports)

napi_status rcd;
napi_value fn;

try

rcd = napi_create_function(env, 0, 0, do_about, 0, &fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to create about");
rcd = napi_set_named_property(env, exports, "about", fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to register about");

catch(std::exception &e)
napi_throw_error(env, 0, e.what());
return exports;
// initialise

NAPI_MODULE(NODE_GYP_MODULE_NAME, initialise)


When I try to load this within the electron main process, I am getting an access violation in the expansion of the NAPI_MODULE macro. I have attempted to debug this by having visual studio attach to the three electron processes before require statement for my native module. I have verified that the initialise() function is not being called but there is an access violation.



Is this something that others have encountered?










share|improve this question














I am working on a c++ native module within electron that formerly used v8 methods to register methods. I have been converting this code to use N-API calls. Here is a snippet of code from this module:



static napi_value initialise(napi_env env, napi_value exports)

napi_status rcd;
napi_value fn;

try

rcd = napi_create_function(env, 0, 0, do_about, 0, &fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to create about");
rcd = napi_set_named_property(env, exports, "about", fn);
if(rcd != napi_ok)
throw std::invalid_argument("unable to register about");

catch(std::exception &e)
napi_throw_error(env, 0, e.what());
return exports;
// initialise

NAPI_MODULE(NODE_GYP_MODULE_NAME, initialise)


When I try to load this within the electron main process, I am getting an access violation in the expansion of the NAPI_MODULE macro. I have attempted to debug this by having visual studio attach to the three electron processes before require statement for my native module. I have verified that the initialise() function is not being called but there is an access violation.



Is this something that others have encountered?







node.js visual-c++ electron node.js-addon n-api






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 20:34









Jon TrauntveinJon Trauntvein

2,7813 gold badges30 silver badges62 bronze badges




2,7813 gold badges30 silver badges62 bronze badges















  • Maybe sharing the access violation stack trace would be helpful.

    – bmacnaughton
    Mar 29 at 12:11

















  • Maybe sharing the access violation stack trace would be helpful.

    – bmacnaughton
    Mar 29 at 12:11
















Maybe sharing the access violation stack trace would be helpful.

– bmacnaughton
Mar 29 at 12:11





Maybe sharing the access violation stack trace would be helpful.

– bmacnaughton
Mar 29 at 12:11












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365785%2fnapi-module-causing-crash%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365785%2fnapi-module-causing-crash%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해