tpisto / pdf-fill-form

Fill PDF forms and return either filled PDF or PDF created from rendered page images.
MIT License
227 stars 48 forks source link

Failed to build on HEROKU #70

Closed vijaypatoliya closed 4 years ago

vijaypatoliya commented 5 years ago

Hello, Really appreciate the anyone help here and thanks in advance.

I am facing issue to use this pkg on Heroku server. As per documentation required this both pkg.

sudo apt-get install libpoppler-qt5-dev libcairo2-dev

I have added buildpack and added both in Aptfile but still getting an error. https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt

Here is a log.

pdf-fill-form@4.1.0 install /tmp/build_8329bf393694998d3af9f7d5160f3fe5/node_modules/pdf-fill-form node-gyp rebuild

   make: Entering directory '/tmp/build_8329bf393694998d3af9f7d5160f3fe5/node_modules/pdf-fill-form/build'
     CXX(target) Release/obj.target/pdf_fill_form/src/pdf-fill-form.o
     CXX(target) Release/obj.target/pdf_fill_form/src/NodePopplerAsync.o
   ../src/NodePopplerAsync.cc: In member function ‘virtual void PdfWriteWorker::HandleOKCallback()’:
   ../src/NodePopplerAsync.cc:47:29: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
          callback->Call(2, argv);
                                ^
   In file included from ../src/NodePopplerAsync.cc:1:0:
   ../../nan/nan.h:1740:3: note: declared here
      Call(int argc, v8::Local<v8::Value> argv[]) const {
      ^
     CXX(target) Release/obj.target/pdf_fill_form/src/NodePoppler.o
   ../src/NodePoppler.cc: In function ‘WriteFieldsParams v8ParamsToCpp(const Nan::FunctionCallbackInfo<v8::Value>&)’:
   ../src/NodePoppler.cc:215:62: error: no matching function for call to ‘v8::Value::ToString()’
      String::Utf8Value sourcePdfFileNameParam(args[0]->ToString());
                                                                 ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2528:44: note: candidate: v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const
      V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                               ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2544:31: note: candidate: v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2544:31: note:   candidate expects 1 argument, 0 provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   ../src/NodePoppler.cc:218:50: error: no matching function for call to ‘v8::Value::ToObject()’
      Local<Object> changeFields = args[1]->ToObject();
                                                     ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
      V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                               ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
                    Local<Object> ToObject(Isolate* isolate) const);
                                  ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2546:31: note:   candidate expects 1 argument, 0 provided
                    Local<Object> ToObject(Isolate* isolate) const);
                                  ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   ../src/NodePoppler.cc:227:36: error: no matching function for call to ‘v8::Value::ToObject()’
        parameters = args[2]->ToObject();
                                       ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2532:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
      V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                               ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2546:31: note: candidate: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
                    Local<Object> ToObject(Isolate* isolate) const);
                                  ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2546:31: note:   candidate expects 1 argument, 0 provided
                    Local<Object> ToObject(Isolate* isolate) const);
                                  ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   ../src/NodePoppler.cc:231:50: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
          String::Utf8Value saveFormatParam(saveParam);
                                                     ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2995:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
        Utf8Value(Isolate* isolate, Local<v8::Value> obj);
        ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
   ../src/NodePoppler.cc:237:39: error: no matching function for call to ‘v8::Value::Int32Value()’
          nCores = coresParam->Int32Value();
                                          ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2569:40: note: candidate: v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const
      V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                           ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2569:40: note:   candidate expects 1 argument, 0 provided
   ../src/NodePoppler.cc:242:46: error: no matching function for call to ‘v8::Value::NumberValue()’
          scale_factor = scaleParam->NumberValue();
                                                 ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2564:39: note: candidate: v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const
      V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                          ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2564:39: note:   candidate expects 1 argument, 0 provided
   ../src/NodePoppler.cc:247:51: error: no matching function for call to ‘v8::Value::BooleanValue()’
          antialiasing = antialiasParam->BooleanValue();
                                                      ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2559:8: note: candidate: bool v8::Value::BooleanValue(v8::Isolate*) const
      bool BooleanValue(Isolate* isolate) const;
           ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2559:8: note:   candidate expects 1 argument, 0 provided
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2562:51: note: candidate: v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const
                    V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                      ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2562:51: note:   candidate expects 1 argument, 0 provided
                    V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                      ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
      declarator __attribute__((deprecated(message)))
      ^
   ../src/NodePoppler.cc:252:60: error: no matching function for call to ‘v8::Object::GetPropertyNames()’
      Local<Array> fieldArray = changeFields->GetPropertyNames();
                                                               ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:3522:43: note: candidate: v8::MaybeLocal<v8::Array> v8::Object::GetPropertyNames(v8::Local<v8::Context>)
      V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetPropertyNames(
                                              ^
   /app/.node-gyp/12.6.0/include/node/v8.h:3522:43: note:   candidate expects 1 argument, 0 provided
   /app/.node-gyp/12.6.0/include/node/v8.h:3524:43: note: candidate: v8::MaybeLocal<v8::Array> v8::Object::GetPropertyNames(v8::Local<v8::Context>, v8::KeyCollectionMode, v8::PropertyFilter, v8::IndexFilter, v8::KeyConversionMode)
      V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetPropertyNames(
                                              ^
   /app/.node-gyp/12.6.0/include/node/v8.h:3524:43: note:   candidate expects 5 arguments, 0 provided
   ../src/NodePoppler.cc:254:42: warning: ‘v8::Local<v8::Value> v8::Object::Get(uint32_t)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
        Local<Value> name = fieldArray->Get(i);
                                             ^
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:3416:55: note: declared here
      V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index));
                                                          ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
      declarator __attribute__((deprecated(message)))
      ^
   ../src/NodePoppler.cc:255:48: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
        Local<Value> value = changeFields->Get(name);
                                                   ^
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:3412:55: note: declared here
      V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
                                                          ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
      declarator __attribute__((deprecated(message)))
      ^
   ../src/NodePoppler.cc:256:47: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
        fields[std::string(*String::Utf8Value(name))] = std::string(*String::Utf8Value(value));
                                                  ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2995:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
        Utf8Value(Isolate* isolate, Local<v8::Value> obj);
        ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
   ../src/NodePoppler.cc:256:89: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
        fields[std::string(*String::Utf8Value(name))] = std::string(*String::Utf8Value(value));
                                                                                            ^
   In file included from /app/.node-gyp/12.6.0/include/node/node.h:63:0,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:2995:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
        Utf8Value(Isolate* isolate, Local<v8::Value> obj);
        ^
   /app/.node-gyp/12.6.0/include/node/v8.h:2995:5: note:   candidate expects 2 arguments, 1 provided
   ../src/NodePoppler.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE ReadSync(Nan::NAN_METHOD_ARGS_TYPE)’:
   ../src/NodePoppler.cc:486:38: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
            fieldArray->Set(fieldNum, obj);
                                         ^
   In file included from /app/.node-gyp/12.6.0/include/node/v8-internal.h:14:0,
                    from /app/.node-gyp/12.6.0/include/node/v8.h:25,
                    from /app/.node-gyp/12.6.0/include/node/node.h:63,
                    from ../../nan/nan.h:54,
                    from ../src/NodePoppler.cc:1:
   /app/.node-gyp/12.6.0/include/node/v8.h:3368:26: note: declared here
                        bool Set(uint32_t index, Local<Value> value));
                             ^
   /app/.node-gyp/12.6.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
      declarator __attribute__((deprecated(message)))
      ^
   pdf_fill_form.target.mk:131: recipe for target 'Release/obj.target/pdf_fill_form/src/NodePoppler.o' failed
   make: *** [Release/obj.target/pdf_fill_form/src/NodePoppler.o] Error 1
   make: Leaving directory '/tmp/build_8329bf393694998d3af9f7d5160f3fe5/node_modules/pdf-fill-form/build'
   gyp ERR! build error 
   gyp ERR! stack Error: `make` failed with exit code: 2
   gyp ERR! stack     at ChildProcess.onExit (/tmp/build_8329bf393694998d3af9f7d5160f3fe5/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
   gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
   gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
   gyp ERR! System Linux 4.4.0-1048-aws
   gyp ERR! command "/tmp/build_8329bf393694998d3af9f7d5160f3fe5/.heroku/node/bin/node" "/tmp/build_8329bf393694998d3af9f7d5160f3fe5/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
   gyp ERR! cwd /tmp/build_8329bf393694998d3af9f7d5160f3fe5/node_modules/pdf-fill-form
   gyp ERR! node -v v12.6.0
   gyp ERR! node-gyp -v v3.8.0
   gyp ERR! not ok 
   npm ERR! code ELIFECYCLE
   npm ERR! errno 1
   npm ERR! pdf-fill-form@4.1.0 install: `node-gyp rebuild`
   npm ERR! Exit status 1
   npm ERR! 
   npm ERR! Failed at the pdf-fill-form@4.1.0 install script.
   npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

   npm ERR! A complete log of this run can be found in:
   npm ERR!     /tmp/npmcache.OTdKD/_logs/2019-09-04T12_35_26_727Z-debug.log

-----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys

   If you're stuck, please submit a ticket so we can help:
   https://help.heroku.com/

   Love,
   Heroku

! Push rejected, failed to compile Node.js app. ! Push failed

tpisto commented 4 years ago

Please try the new version - v5.0.0