# Lambda Layers & Node & require the layer code & sls invoke local

**URL:** <https://forum.serverless.com/t/lambda-layers-node-require-the-layer-code-sls-invoke-local/6673>\
**Category:** Serverless Framework\
**Created:** [December 6, 2018, 11:33pm UTC](https://forum.serverless.com/t/lambda-layers-node-require-the-layer-code-sls-invoke-local/6673 "2018-12-06T23:33:14Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![ken](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@ken](https://forum.serverless.com/u/ken)\
**Post date:** [June 24, 2021, 8:12am UTC](https://forum.serverless.com/t/lambda-layers-node-require-the-layer-code-sls-invoke-local/6673/20 "2021-06-24T08:12:41Z")

</div>

If you have trouble with this part [AWS - Layers: Using your layers](https://www.serverless.com/framework/docs/providers/aws/guide/layers/#using-your-layers),

> To use a layer with a function in the same service, use a CloudFormation Ref. The name of your layer in the CloudFormation template will be your layer name TitleCased (without spaces) and have `LambdaLayer` appended to the end. EG:  
> the next code will help you.

- wrong

```auto
layers:
  test:
    path: layer
functions:
  hello:
    handler: handler.hello
    layers:
      - { Ref: TestLambdaLayer }

```

- right

```auto
layers:
  Test:
    path: layer
functions:
  hello:
    handler: handler.hello
    layers:
      - { Ref: TestLambdaLayer }

```

This phenomenon may happen when layers name is equal to service name. That’s because layers name create zip file (e.g.Test.zip) as well as service name create zip file (e.g.test.zip) when sls deploy with cloudformation info.

I wrote the same issue [here](http://forum.serverless.com/t/aws-lambda-layers-node-modules-not-working/7914/4).

---

_[View the full topic](https://forum.serverless.com/t/lambda-layers-node-require-the-layer-code-sls-invoke-local/6673)._
