dimkir / nightmare-lambda-tutorial

Sample project and tutorial to run NightmareJS on AWS Lambda
75 stars 9 forks source link

Does this lib support Node v.10 ? #11

Open iblessedi opened 4 years ago

iblessedi commented 4 years ago

I used this lib with Node v8 on Lambda and it worked well. But I got an email from AWS that very soon Node v8 will be suspended on Lambda, everybody needs to upgrade to Node v10. I tried and get an error

RangeError: Maximum call stack size exceeded at Array.JSON.stringify (/var/runtime/node_modules/lambda-logging/Layout.js:63:45)

the same code which worked on node 8 won't work on node 10.

Can this be solved?

Antditto commented 4 years ago

I am also seeing this issue and have isolated the problem to this. Does anyone have a workaround for Node 10.x runtime env?

olexstad commented 4 years ago

I have same issue. I tried to upgrade to Node 10, but I get an error like @iblessedi . We have to wait for fix... Hope it will come soon.

themattrobinson commented 4 years ago

Side question- I don't recall seeing any announcement about AWS removing Node V8 support "very soon"... could someone please link me to that?

Antditto commented 4 years ago

Side question- I don't recall seeing any announcement about AWS removing Node V8 support "very soon"... could someone please link me to that?

https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html

themattrobinson commented 4 years ago

Thanks @Antditto- not sure how I missed that.

Well while we're on the topic of updating the lib to support Node v10, it would also be the perfect time to update the Electron binary to a (much) newer version.

dimkir commented 4 years ago

The /var/runtime/node_modules/lambda-logging/Layout.js:63:45 is actually part of AWS lambda runtime (which AWS Lambda team works on).

I wonder whether you encounter this error every time when running nightmare on Node 10?

Or only under certain circumstances?

Also is there more to the stack trace?

Obviously there's some problem with JSON stringification of very deep object... Did Node 10x change max depth of JSON object? Also I wonder why is it Array.JSON.Stringify ? From what I know JSON is an object [[prototype]] linked to Object not to Array...

iblessedi commented 4 years ago

I see this each time I run my code. Also I see this even when I run it locally via SAM.

RangeError: Maximum call stack size exceeded at Array.JSON.stringify (/var/runtime/node_modules/lambda-logging/Layout.js:63:45) at JSON.stringify () at TextLayout.format (/var/runtime/node_modules/lambda-logging/Layout.js:63:29) at ConsoleAppender.append (/var/runtime/node_modules/lambda-logging/ConsoleAppender.js:27:28) at Logger.putEvent (/var/runtime/node_modules/lambda-logging/Logger.js:77:20) at process.on.error (/var/runtime/index.js:32:10) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:497:27)

iblessedi commented 4 years ago

This library does not support Node 10! And in Feb 2020 AWS won't allow us to create function using Node 8. We moved to Puppeteer - that was the easiest solution for us.

themattrobinson commented 4 years ago

This library does not support Node 10! And in Feb 2020 AWS won't allow us to create function using Node 8. We moved to Puppeteer - that was the easiest solution for us.

We are also in the process of moving to Puppeteer.

iblessedi commented 4 years ago

I think it would be great if the author wrote on the main page of the lib that currently it is not supported. This may save somebody's time...