php icon indicating copy to clipboard operation
php copied to clipboard

Composer validation always fails

Open asispts opened this issue 2 years ago • 6 comments

Bug report

  • Version: 0.5.2
  • URL: No
  • Repository: No

Description

When modify composer.json (e.q: add/remove a package), build process always fail to detect the change. The build process always use the same cache.

Installing Composer dependencies [START]
[8.0MiB/0.13s] Installing dependencies from lock file
[8.2MiB/0.13s] Verifying lock file contents can be installed on current platform.
[8.4MiB/0.13s] Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
[9.8MiB/0.18s] Nothing to install, update or remove
[9.8MiB/0.18s] Generating optimized autoload files

Composer validation shows that composer.json is valid.

$ composer validate
./composer.json is valid

Solution

Redeploy without using existing build cache manually.

asispts avatar Nov 29 '22 20:11 asispts

Just want to share with anyone else. You can use ENV to skip using build cache.

See: https://vercel.com/docs/concepts/deployments/troubleshoot-a-build#managing-build-cache

zhanang19 avatar Mar 09 '23 13:03 zhanang19

Hi @asispts. Do you have composer.lock versioned in your project?

f3l1x avatar Mar 27 '23 14:03 f3l1x

Hi @asispts. Do you have composer.lock versioned in your project?

Yes

asispts avatar Mar 27 '23 16:03 asispts

So let me summarize this problem.

  1. Create project with composer.json + composer.lock + vercel.json + /api/index.php.
  2. Deploy to vercel.
  3. Modify composer.json + composer.lock (after calling composer update for example).
  4. Deploy to vercel.
  5. See -> Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.

Right?

f3l1x avatar Mar 28 '23 06:03 f3l1x

Yes, that's the steps to reproduce the issue. However, on the step 3, it's better to add a new package and use it in /api/index.php.

asispts avatar Mar 28 '23 12:03 asispts