# Chrome-aws-lambda trouble importing

**URL:** <https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664>\
**Category:** Support\
**Tags:** lambda-functions\
**Created:** [August 10, 2019, 5:38pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664 "2019-08-10T17:38:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeAmend](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/codeamend/32/2289_2.png) [@CodeAmend](https://answers.netlify.com/u/CodeAmend)\
**Post date:** [August 10, 2019, 5:38pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/1 "2019-08-10T17:38:54Z")

</div>

Using this as an example: [Netlify-Labs headless chrome](https://github.com/netlify-labs/netlify-functions-headless-chrome)

I have successfully set up lambda functions (pretty damn cool!), but I am having a few issues.

### My environment

I have node v8.10 installed locally and have `strictEngine` set in the `package.json` . I have also pushed this to netlify so I can try outside of my local environment.

### What I am trying to accomplish

I need a headless chrome instance so that I can render a canvas and convert it to a png file and send it to Contentful, so using lambda functions should be a good solution.

### What I am having problems with.

but I am having trouble importing some packages. Such as, [GitHub - alixaxel/chrome-aws-lambda: Chromium Binary for AWS Lambda and Google Cloud Functions](https://github.com/alixaxel/chrome-aws-lambda) without getting many errors.

First error: `ModuleNotFoundError: Module not found: Error: Can't resolve 'iltorb'`

I install iltorb..

Next errors `Module not found: Error: Can't resolve 'bufferutil'` `ERROR in **/node_modules/iltorb/build/bindings/iltorb.node 1:0 Module parse failed: Unexpected character '' (1:0)`

I install bufferutil… then these continue to appear… `ERROR in /home/mibru/code/clients/mark-maps/node_modules/iltorb/build/bindings/iltorb.node 1:0 Module parse failed: Unexpected character '' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file) @ /home/mibru/code/clients/mark-maps/node_modules/iltorb/index.js 10:39-78 @ /home/mibru/code/clients/mark-maps/node_modules/chrome-aws-lambda/source/index.js`

Would anyone mind helping me solve this? Or if you know other packages, I am open to using another solution, as long as I can use lambda functions.

I realize it could be including binaries but I am unsure how to work with this stuff.  
[https://answers.netlify.com/t/include-binaries-in-function-netlify-lambda/424](https://answers.netlify.com/t/include-binaries-in-function-netlify-lambda/424)

I appreciate in advance the patience.

---

<div class="post-metadata">

**Author:** ![d00kIe](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/d00kie/32/289_2.png) [@d00kIe](https://answers.netlify.com/u/d00kIe)\
**Post date:** [August 30, 2019, 10:46pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/3 "2019-08-30T22:46:46Z")

</div>

I have the same issue. Anyone ?

---

<div class="post-metadata">

**Author:** ![CodeAmend](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/codeamend/32/2289_2.png) [@CodeAmend](https://answers.netlify.com/u/CodeAmend)\
**Post date:** [August 30, 2019, 11:18pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/4 "2019-08-30T23:18:17Z")

</div>

Constant trouble. You will have to upgrade Netlify to handle that large of file. I am currently needing webgl so i have had to use aws lambda instead of Netlify.

---

<div class="post-metadata">

**Author:** ![futuregerald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/futuregerald/32/33_2.png) [@futuregerald](https://answers.netlify.com/u/futuregerald)\
**Post date:** [September 4, 2019, 7:17pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/5 "2019-09-04T19:17:36Z")

</div>

Hi @CodeAmend, can you clarify what you mean by “upgrade netlify to handle that large of a file”? Is there a problem with deployment? or are you getting that error when the function is invoked?

Also, are you doing a zip based deploy? What happens if you take that same zip that works on lambda directly and deploy it via Netlify?

---

<div class="post-metadata">

**Author:** ![CodeAmend](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/codeamend/32/2289_2.png) [@CodeAmend](https://answers.netlify.com/u/CodeAmend)\
**Post date:** [September 5, 2019, 2:10pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/6 "2019-09-05T14:10:05Z")

</div>

Hello Futuregerald,

Netlify is not taking a zip that is a little under 100mb. It will most likely work on Netlify, but i am using aws right now because there is no need to upgrade accounts with this method.

I prob need 1 to 2gb of ram and the ability to wait until a browser has loaded the entire set of map tiles, which could be anywhere from 5 sec to 30sec. So if that would be considered timeout, i am not sure how to handle that.

---

<div class="post-metadata">

**Author:** ![futuregerald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/futuregerald/32/33_2.png) [@futuregerald](https://answers.netlify.com/u/futuregerald)\
**Post date:** [September 5, 2019, 3:02pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/7 "2019-09-05T15:02:16Z")

</div>

Hi,

How are you deploying? that’s a big factor. Also note that you can zip the function inside of our build environment. If you have a repo that has the failing deployment then please share a link. Thanks.

---

<div class="post-metadata">

**Author:** ![CodeAmend](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/codeamend/32/2289_2.png) [@CodeAmend](https://answers.netlify.com/u/CodeAmend)\
**Post date:** [September 6, 2019, 1:52pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/8 "2019-09-06T13:52:32Z")

</div>

Its also the size github can handle. I do not want to push a 70mb file each time i update my commits. Is there a way i can upload a zip to netlify separately? I also dont like the idea of rebuilding this lambda file each time my client pushes a blog post to contentful.

Is there a way to decouple the lambda zip build from each Netlify build?

Do i really need to push a 70mb file to my git repo?

---

<div class="post-metadata">

**Author:** ![CodeAmend](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/codeamend/32/2289_2.png) [@CodeAmend](https://answers.netlify.com/u/CodeAmend)\
**Post date:** [September 6, 2019, 1:53pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/9 "2019-09-06T13:53:34Z")

</div>

Also, just so you understand, i need to use webgl with headless chrome. This is why the file is so big because chrome is large.

---

<div class="post-metadata">

**Author:** ![futuregerald](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/futuregerald/32/33_2.png) [@futuregerald](https://answers.netlify.com/u/futuregerald)\
**Post date:** [September 9, 2019, 7:29pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/10 "2019-09-09T19:29:45Z")

</div>

Have you looked in to using git-lfs? that may work for deploying a large file, though I recommend testing it separately and not in production. Netlify Large Media won’t work for this since the file wouldn’t be available during your build step. You can also stash the file in the build cache and restore it from build cache with each deploy. There are libraries that can help with this, like [cache-me-outside - npm](https://www.npmjs.com/package/cache-me-outside)

---

<div class="post-metadata">

**Author:** ![CodeAmend](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/codeamend/32/2289_2.png) [@CodeAmend](https://answers.netlify.com/u/CodeAmend)\
**Post date:** [September 10, 2019, 5:52pm UTC](https://answers.netlify.com/t/chrome-aws-lambda-trouble-importing/2664/11 "2019-09-10T17:52:42Z")

</div>

I appreciate you reaching out. If I could just use Netlify platform, I would feel so much better. I will look into this soon.
