Giter Site home page Giter Site logo

Comments (3)

t-richard avatar t-richard commented on September 2, 2024 1

This warning is not coming from Lift but from the Serverless framework itself.

See https://github.com/serverless/serverless/blob/master/lib/configuration/variables/sources/file.js#L51-L57

The docs states the following

Files need to be referenced by relative paths, which should not reach out beyond project directory (by default service directory). If you work with multi-service project, you can change project directory boundary with projectDir setting (e.g. set projectDir: ../ if you're service is nested in top level service-x directory)

Not sure why you don't encounter this in your other projects though. Maybe you are using an older version of the framework in those projects ? Or you defined the projectDir configuration option ?

In any way, we can't really do something about it in Lift.

from lift.

t-richard avatar t-richard commented on September 2, 2024

Hi @Abhijith-Nagaraja

I was able to reproduce with a setup similar to yours.

The error you have is linked to your config.yml file being outside of your project directory (referenced with ..).

You should even see that serverless gives you a warning about that

Variables resolver reports following resolution errors:
- Cannot resolve variable at "custom": Cannot load file from outside of a project directory (configure "projectDir" to extend project boundary)
From a next major this will be communicated with a thrown error.

Moving the config file inside the project directory or setting projectDir: .. should solve the issue.

Let me know if that works for you.

from lift.

Abhijith-Nagaraja avatar Abhijith-Nagaraja commented on September 2, 2024

Hi @t-richard,

Thanks for the quick reply. Yes you are correct. Once I moved it inside project directory, it worked.

However I still feel this is a bug. Here is my reasoning.

Configs files can be anywhere, we should be able to refer to it as long we have system file access for the user. I don't experience this issue w.r.t my own plugins or some other plugin I use. I guess serverless-lift is restricting it to project directory.

Saying that, for me it make sense to keep configs at one level higher. As I have multiple small projects which I combine in one repo. Here is my structure

root
|
- Project 1
-- serverless.yml
- Project 2
-- serverless.yml
...
- Config
-- Project 1
--- dev.yml
--- test.yml
--- prod.yml
-- Project 2
--- dev.yml
--- test.yml
--- prod.yml
....

So in my case, although it's doable to bring configs under each project, that just not preferred

If you don't feel this is a bug, please feel free to close this issue.

from lift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.