# Variables resolver deprecation: Cannot load file from outside of service folder

**URL:** <https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185>\
**Category:** Serverless Framework\
**Created:** [February 27, 2021, 12:30am UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185 "2021-02-27T00:30:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![danrivett](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/danrivett/32/4304_2.png) [@danrivett](https://forum.serverless.com/u/danrivett)\
**Post date:** [February 27, 2021, 12:30am UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/1 "2021-02-27T00:30:40Z")

</div>

I currently have the following in my `serverless.yml` file which has been working just fine:

```auto
custom:
  webpack: ${file(../../../shared/services/webpack.config.yml)}

```

But after upgrading Serverless version to `2.28.0`, I now see the following deprecation warning:

```auto
Serverless: Deprecation warning: Variables resolver reports following resolution errors:
              - Cannot resolve variable at "custom.webpack": Cannot load file from outside of service folder

```

Is this a new deliberate limitation of not being able to reference configuration files from ancestor directories, since I use that to share configuration between multiple serverless files in different code directory branches like the following:

```auto
aggregates
    - aggregate-A
        - libraries
            - ...
        - services
            - service-A1
                - serverless.yml
    - aggregate-B
        - libraries
            - ...
        - services
            - service-B1
                - serverless.yml
shared
    - services
        - webpack.config.yml

```

This allows me to group services by aggregate, but also have cross-cutting concerns outside that hierarchy.

Is this layout going to be broken in the future, or is there some way of still supporting this and removing the deprecation warning?

---

<div class="post-metadata">

**Author:** ![GioAgu17](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gioagu17/32/5310_2.png) [@GioAgu17](https://forum.serverless.com/u/GioAgu17)\
**Post date:** [March 1, 2021, 5:48pm UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/3 "2021-03-01T17:48:08Z")

</div>

I have the same concern. Following the monorepo/multiple services approach described here: [Share Code Between Services | Serverless Stack](https://serverless-stack.com/chapters/share-code-between-services.html). What could be the workaround for this?

---

<div class="post-metadata">

**Author:** ![mchisz](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mchisz](https://forum.serverless.com/u/mchisz)\
**Post date:** [March 2, 2021, 4:19pm UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/4 "2021-03-02T16:19:27Z")

</div>

I am also concerned about this, we are using a monorepo type structure with multiple microservices, each with their own serverless.yml. It doesn’t make sense to not be able to share variables between the projects.

---

<div class="post-metadata">

**Author:** ![tomoima525](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tomoima525/32/5318_2.png) [@tomoima525](https://forum.serverless.com/u/tomoima525)\
**Post date:** [March 2, 2021, 6:00pm UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/5 "2021-03-02T18:00:00Z")

</div>

Just ran into this issue. Looking for a way to fix this properly!

---

<div class="post-metadata">

**Author:** ![garethmcc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/garethmcc/32/2276_2.png) [@garethmcc](https://forum.serverless.com/u/garethmcc)\
**Post date:** [March 3, 2021, 6:48am UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/6 "2021-03-03T06:48:56Z")

</div>

Please note that this is not removing support for external files. This was fixed in 2.28.2: [Release 2.28.2 (2021-03-02) · serverless/serverless · GitHub](https://github.com/serverless/serverless/releases/tag/v2.28.2)

---

<div class="post-metadata">

**Author:** ![garethmcc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/garethmcc/32/2276_2.png) [@garethmcc](https://forum.serverless.com/u/garethmcc)\
**Post date:** [March 3, 2021, 6:49am UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/7 "2021-03-03T06:49:24Z")

</div>

I am just closing this topic so there is no more confusion

---

<div class="post-metadata">

**Author:** ![garethmcc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/garethmcc/32/2276_2.png) [@garethmcc](https://forum.serverless.com/u/garethmcc)\
**Post date:** [March 3, 2021, 6:49am UTC](https://forum.serverless.com/t/variables-resolver-deprecation-cannot-load-file-from-outside-of-service-folder/14185/8 "2021-03-03T06:49:32Z")

</div>


