fxpio / foxy

A fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer
https://foxypkg.com
MIT License
173 stars 21 forks source link

[RuntimeException] The asset manager ended with an error #15

Closed Defcon0 closed 6 years ago

Defcon0 commented 6 years ago

Hello,

we just saw this plugin and would love to integrate it into our libraries. What I did is the following:

  1. Require foxy in the project's composer.json
  2. Added the following to the project's composer.json:
    "foxy": {
      "manager": "yarn",
      "manager-version": "^1.5.0"
    },
  3. Added the extra flag foxy: true in the library's composer.json
  4. Added the package.json to the library.
  5. Run composer update in my project.

After running composer update, I get:

() at /home/myuser/Kunden/customer/proj/produkte/contao/vendor/foxy/foxy/Solver/Solver.php:108 Foxy\Solver\Solver->solve() at /home/myuser/Kunden/customer/proj/produkte/contao/vendor/foxy/foxy/Foxy.php:131 Foxy\Foxy->solveAssets() at n/a:n/a call_user_func() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:171 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:96 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Installer.php:322 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:161 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:242 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:842 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:193 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:251 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:100 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:58 require() at /usr/local/bin/composer:24

The generated file package.jsonin the vendor/foxy folder is

{ "dependencies": { "masonry-layout": "^4.2" }, "name": "@composer-asset/heimrichhannot--contao-list-bundle", "version": "dev-master" }

In case you want to check the files in our library, it's https://github.com/heimrichhannot/contao-list-bundle

Thanks in advance.

Bye

Defcon0 commented 6 years ago

OK, I found the issue. My package.json in the library didn't have a name and a version set. So foxy set version in the generated package.json file to "dev-master" (which was the version constraint in my composer.json).

@francoispluchino Maybe foxy should set the version in the generated package.json to 1.0.0 if no numeric version has been set in the php lib's package.json?

francoispluchino commented 6 years ago

The package.json file must be respect the NPM definition of package, and not the Composer definition. Glad to know that you have solved your problem.