# Error: Cannot find module 'sharp' in Netlify Function log with NextJS and previews

**URL:** <https://answers.netlify.com/t/error-cannot-find-module-sharp-in-netlify-function-log-with-nextjs-and-previews/80450>\
**Category:** Support\
**Tags:** nextjs\
**Created:** [December 4, 2022, 12:58am UTC](https://answers.netlify.com/t/error-cannot-find-module-sharp-in-netlify-function-log-with-nextjs-and-previews/80450 "2022-12-04T00:58:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![crcollver](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/crcollver/32/13581_2.png) [@crcollver](https://answers.netlify.com/u/crcollver)\
**Post date:** [December 5, 2022, 8:28pm UTC](https://answers.netlify.com/t/error-cannot-find-module-sharp-in-netlify-function-log-with-nextjs-and-previews/80450/4 "2022-12-05T20:28:48Z")

</div>

Adding the `included_files` property with a value of `["node_modules/sharp/**/*"]` solved the issue!

What’s funny is I had read that thread a day prior to writing my post and saw that the original poster had the property in their configuration file, but they had no success with it so I never tried it. Great timing that they responded!

@Kimfucious, I did install sharp first and had made sure to reference it in my `netlify.toml` under the `external_node_modules` property, but unfortunately had no luck. I had found that solution from a thread you had started actually! 🙂

Thank you guys for the help!

My only question is why adding the `external_node_modules` property wasn’t enough to include it in the Netlify function deployment in this particular instance?

---

_[View the full topic](https://answers.netlify.com/t/error-cannot-find-module-sharp-in-netlify-function-log-with-nextjs-and-previews/80450)._
