# Using Serverless Framework with serverless-bundle for using custom layers in a lambda

**URL:** <https://forum.serverless.com/t/using-serverless-framework-with-serverless-bundle-for-using-custom-layers-in-a-lambda/20795>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [November 24, 2024, 4:19pm UTC](https://forum.serverless.com/t/using-serverless-framework-with-serverless-bundle-for-using-custom-layers-in-a-lambda/20795 "2024-11-24T16:19:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AvinashK232](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/avinashk232/32/8178_2.png) [@AvinashK232](https://forum.serverless.com/u/AvinashK232)\
**Post date:** [November 24, 2024, 4:19pm UTC](https://forum.serverless.com/t/using-serverless-framework-with-serverless-bundle-for-using-custom-layers-in-a-lambda/20795/1 "2024-11-24T16:19:12Z")

</div>

Trying to have a custom code as part of lambda layer. However when trying to import the same inside a lambda function getting an error. The layer works fine if i remove the serverless-bundle.

Error:

```auto
[OperationalError: ENOENT: no such file or directory, lstat '/services/xyz/.webpack/dependencies/node_modules'] {
  cause: [Error: ENOENT: no such file or directory, lstat '/services/xyz/.webpack/dependencies/node_modules'] {
    errno: -2,
    code: 'ENOENT',
    syscall: 'lstat',
    path: '/services/xyz/.webpack/dependencies/node_modules'
  },
  isOperational: true,
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/services/xyz/.webpack/dependencies/node_modules'
}

```
