bref icon indicating copy to clipboard operation
bref copied to clipboard

I cant separate my vendor folder from my app folder, i get Unrecognized configuration variable sources: "bref"

Open oluwapaso opened this issue 3 years ago • 2 comments

service: app

provider:
    name: aws
    runtime: provided.al2
    
    environment:
        BREF_AUTOLOAD_PATH: '/tmp/vendor/autoload.php'

functions:
    foo:
        handler: index.php
        layers:
            - ${bref:layer.php-81} # PHP
custom:
    bref:
        separateVendor: true

Hi, please I am having an issue separating my vendor folder from the main app folder. The above serverless.yml settings give Unrecognized configuration variable sources: "bref". But if I add this block

plugins:
  - ./vendor/bref/bref

it includes the vendor folder in the app folder which makes it too big and I can't edit my code in lambda in-line editor

oluwapaso avatar Jun 30 '22 01:06 oluwapaso

Interesting, normally with separateVendor: true the vendor directory should be automatically excluded.

Could you confirm your Bref version?

And maybe try excluding the folder manually with this config:

package:
    patterns:
        - '!vendor/**'

mnapoli avatar Jun 30 '22 09:06 mnapoli

With respect to the problem indicated in the title, the Unrecognized configuration variable sources: "bref" comes from the fact that the call to the plugin is missing. Please add the following to your serverless.yml when using Bref:

plugins:
  - ./vendor/bref/bref

When using separateVendor: true , the vendor/ directory is excluded from the zip file uploaded to S3 (and deployed to Lambda). You can verify it by running unzip -l on the zip file created on your machine:

$ unzip -l .serverless/bref-debug.zip
Archive:  .serverless/bref-debug.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      109  01-01-1980 00:00   composer.json
    64836  01-01-1980 00:00   composer.lock
      304  01-01-1980 00:00   index.php
---------                     -------
    65249                     3 files
# Note: replace "bref-debug" with the name of your application

If your zip file is bigger than 3 MB, it will be unavailable in the Lambda Editor on the Console. Please check if you didn't include a picture or a big text file. Or maybe, your project is simply too big.

If the problem persists, can you confirm the version of Bref you are running?

afu-dev avatar Aug 09 '22 13:08 afu-dev

Closing because of inactivity.

mnapoli avatar Oct 20 '22 11:10 mnapoli