Packages in Sage 10 not working on deployment

Hello, i’ve been making deployments with older versions of Sage but with Sage 10 I have some errors. When I deploy to production via FTP following the instructions from Sage docs (yarn build && composer install --no-dev excluding node_modules), apparently some packages installed via composer on local do not work on production.

I tried to make a fresh composer install in production too without success. PHP versions are identical, and modules / server requirements are fine. I can’t understand why some packages like generoi/sage-woocommerce or log1x/sage-svg added in development don’t work in production.

I will appreciate any help. Thank you very much.

Can you post your composer.json?

Are the packages in question in your vendor folder on the remote server?

Yes, I confirm all packages are uploaded in vendor folder on remote. Oddly, only the packages added with composer require aftewards are not working in production.

composer.json

{
  "name": "roots/sage",
  "type": "wordpress-theme",
  "license": "MIT",
  "description": "WordPress starter theme with a modern development workflow",
  "homepage": "https://roots.io/sage/",
  "authors": [
    {
      "name": "Ben Word",
      "email": "ben@benword.com",
      "homepage": "https://github.com/retlehs"
    },
    {
      "name": "Scott Walkinshaw",
      "email": "scott.walkinshaw@gmail.com",
      "homepage": "https://github.com/swalkinshaw"
    },
    {
      "name": "QWp6t",
      "email": "hi@qwp6t.me",
      "homepage": "https://github.com/qwp6t"
    },
    {
      "name": "Brandon Nifong",
      "email": "brandon@tendency.me",
      "homepage": "https://github.com/log1x"
    }
  ],
  "keywords": [
    "wordpress"
  ],
  "support": {
    "issues": "https://github.com/roots/sage/issues",
    "forum": "https://discourse.roots.io/"
  },
  "autoload": {
    "psr-4": {
      "App\\": "app/"
    }
  },
  "require": {
    "php": "^7.4|^8.0",
    "generoi/sage-woocommerce": "^1.0",
    "log1x/sage-svg": "^1.0",
    "roots/acorn": "^2.0"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^3.6"
  },
  "suggest": {
    "log1x/sage-directives": "A collection of useful Blade directives for WordPress and Sage (^1.0).",
    "log1x/sage-svg": "A useful SVG directive for inlining SVG's within Blade views (^1.0)."
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "scripts": {
    "lint": [
      "phpcs --extensions=php --standard=PSR12 app"
    ]
  },
  "extra": {
    "acorn": {
      "providers": [
        "App\\Providers\\ThemeServiceProvider"
      ]
    }
  },
  "post-autoload-dump": [
    "Roots\\Acorn\\ComposerScripts::postAutoloadDump"
  ]
}

Maybe this will help you further? Acorn issue on shared host

Thanks @cim The thread has pointed to a partial solution. I’m not deploying to shared host, but to an AWS instance running Ubuntu, so I decided to delete composer.lock and running composer install --no-dev from there. After that I ran wp acorn package:discover and the package generoi/sage-woocommerce was working as in locahost. Unfortunately the trick didn’t work for log1x/sage-svg but I changed my code to avoid errors with the directive @svg provided by the package.

To be honest, I don’t fully understand why the deployment did not work :pensive: