# Module not found when using Lambda Layer (node js, webpack)

**URL:** <https://forum.serverless.com/t/module-not-found-when-using-lambda-layer-node-js-webpack/11991>\
**Category:** Serverless Framework\
**Created:** [July 10, 2020, 3:43pm UTC](https://forum.serverless.com/t/module-not-found-when-using-lambda-layer-node-js-webpack/11991 "2020-07-10T15:43:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattTheArcher](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@MattTheArcher](https://forum.serverless.com/u/MattTheArcher)\
**Post date:** [July 10, 2020, 3:43pm UTC](https://forum.serverless.com/t/module-not-found-when-using-lambda-layer-node-js-webpack/11991/1 "2020-07-10T15:43:30Z")

</div>

Hi, I’m new to this, so this may be simple thing.

I have a simple lambda. In it I `npm i axios --save`, and in my code, I `require(axios)`. This works great.

Now I want to extract axios into a layer so I can use it in other lambdas. I follow all steps, when deploying, I see the layer, and the contents of the .zip make sense. This is the yml config:

`layers: thirdParty: path: src/layers/thirdParty description: All 3rd party libraries used by user-service`

and for the lambda function:

`funcName: handler: src/handlers/funcName.handler layers: - { Ref: ThirdPartyLambdaLayer } `  
I also `npm uninstall axios --save` from the function, as the hope is, it’ll pick it up from the layer.

And it might, but when I try to `sls deploy`, I get an error that axios module cannot be found - seems like webpack can’t locate the module because it has been removed from the function itself, and is unaware of the `thirdParty` layer.

Any ideas for how to fix this?

Thank you!
