Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Build fails with: conversion from Nan::Maybe<double> to v8::Maybe<double> #4

Open
benbucksch opened this issue Mar 18, 2020 · 4 comments · May be fixed by #6
Open

Build fails with: conversion from Nan::Maybe<double> to v8::Maybe<double> #4

benbucksch opened this issue Mar 18, 2020 · 4 comments · May be fixed by #6

Comments

@benbucksch
Copy link

Environment:

  • node 13.2.0
  • Linux

Reproduction:

  • yarn add pv-porcupine

Actual result:

  • Build starts and fails with:
porcupine.cc:131:59: error: conversion from ‘Nan::imp::ValueFactoryBase<double>::return_t’ {aka ‘Nan::Maybe<double>’} to non-scalar type ‘v8::Maybe<double>’ requested
  131 |         v8::Maybe<double> sensitivityVal = Nan::To<double>(Nan::Get(keywordObject, sensitivityKeyStr).ToLocalChecked());
      |                                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected result:

  • Builds successfully
@benbucksch
Copy link
Author

Fix:

Changing porcupine.cc line 131 from V8::Maybe<double> sensitivityVal = to Nan::Maybe<double> sensitivityVal = allows me to build successfully.

@gormonn
Copy link

gormonn commented Apr 14, 2020

@benbucksch Hello! How to do that?

@SteTR
Copy link

SteTR commented Aug 15, 2020

Bringing this issue back up. I changed the line but not sure how to get it functioning after that @benbucksch, what did you do afterwards?

@benbucksch
Copy link
Author

benbucksch commented Aug 15, 2020

As mentioned in my comment, this one change was all that was needed.

If your question is how to compile and use this changed source code, then I guess your easiest solution is to install my fixed version in https://github.com/benbucksch/pv-porcupine/ instead:

  • npm install https://github.com/benbucksch/pv-porcupine/
  • yarn add https://github.com/benbucksch/pv-porcupine/

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

Successfully merging a pull request may close this issue.

3 participants