-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while trying to build phar file #492
Comments
Just to check if it's a Box issue, does it build if you run: vendor/laravel-zero/framework/bin/box compile --config box.json You should end up with a file called Can also add a Also, could you provide some information on your setup? Which OS and PHP version are you using? |
Thanks for the reply @owenvoke. Still failing and phar file is not created, but I got a different error message:
Is weird to see this error since my Project structure: ![]() Error: Full Stacktrace: vendor/laravel-zero/framework/bin/box compile --config box.json --debug
[debug] Changed the memory limit from "128MB" to "512M"
[debug] Checking BOX_ALLOW_XDEBUG
[debug] phar.readonly is enabled
[debug] The Xdebug extension is not loaded
[debug] Configured `phar.readonly=0`
[debug] Process restarting (BOX_ALLOW_XDEBUG=internal||1|*|*)
[debug] Running: [/usr/local/Cellar/php/8.3.7/bin/php, vendor/laravel-zero/framework/bin/box, compile, --config, box.json, --debug]
[debug] Current memory limit: "512MB"
[debug] Checking BOX_ALLOW_XDEBUG
[debug] Restarted (127 ms). The Xdebug extension is not loaded
____
/ __ )____ _ __
/ __ / __ \| |/_/
/ /_/ / /_/ /> <
/_____/\____/_/|_|
Box version 4.6.2@29c3585 2024-04-23 19:35:41 UTC
// Loading the configuration file "box.json".
[ERROR] The configuration file is invalid.
In Assert.php line 1012:
[_HumbugBoxc5dcacdc09f0\Webmozart\Assert\InvalidArgumentException]
The file "/Users/ahinojosa/workspace/movie-cli/builds/movie-cli" does not exist.
Exception trace:
at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/webmozart/assert/src/Assert.php:1012
_HumbugBoxc5dcacdc09f0\Webmozart\Assert\Assert::reportInvalidArgument() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/webmozart/assert/src/Assert.php:691
_HumbugBoxc5dcacdc09f0\Webmozart\Assert\Assert::fileExists() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/webmozart/assert/src/Assert.php:696
_HumbugBoxc5dcacdc09f0\Webmozart\Assert\Assert::file() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/src/Configuration/Configuration.php:786
_HumbugBoxc5dcacdc09f0\KevinGH\Box\Configuration\Configuration::retrieveMainScriptPath() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/src/Configuration/Configuration.php:147
_HumbugBoxc5dcacdc09f0\KevinGH\Box\Configuration\Configuration::create() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/src/Configuration/ConfigurationLoader.php:21
_HumbugBoxc5dcacdc09f0\KevinGH\Box\Configuration\ConfigurationLoader->loadFile() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/src/Console/ConfigurationLoader.php:22
_HumbugBoxc5dcacdc09f0\KevinGH\Box\Console\ConfigurationLoader::getConfig() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/src/Console/Command/ConfigOption.php:22
_HumbugBoxc5dcacdc09f0\KevinGH\Box\Console\Command\ConfigOption::getConfig() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/src/Console/Command/CompileCommand.php:115
_HumbugBoxc5dcacdc09f0\KevinGH\Box\Console\Command\CompileCommand->execute() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/fidry/console/src/Bridge/Command/SymfonyCommand.php:69
_HumbugBoxc5dcacdc09f0\Fidry\Console\Bridge\Command\SymfonyCommand->execute() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/symfony/console/Command/Command.php:151
_HumbugBoxc5dcacdc09f0\Symfony\Component\Console\Command\Command->run() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/symfony/console/Application.php:690
_HumbugBoxc5dcacdc09f0\Symfony\Component\Console\Application->doRunCommand() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/symfony/console/Application.php:230
_HumbugBoxc5dcacdc09f0\Symfony\Component\Console\Application->doRun() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/symfony/console/Application.php:123
_HumbugBoxc5dcacdc09f0\Symfony\Component\Console\Application->run() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/vendor/fidry/console/src/Application/ApplicationRunner.php:39
_HumbugBoxc5dcacdc09f0\Fidry\Console\Application\ApplicationRunner->run() at phar:///Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box/bin/box:47
require() at /Users/ahinojosa/workspace/movie-cli/vendor/laravel-zero/framework/bin/box:19 |
I'm having exactly the same issue with: laravel-zero/foundation v11.5.0 |
Sorry, I completely forgot to get back to this. I was able to replicate it locally. Unfortunately, I don't have time at the moment to investigate it further though. I'm pretty sure it's something to do with the current working directory that Box runs in (possibly due to the binary being re-run). |
No worries. I downgraded my project back to laravel-zero 10 and build seems to work now fine. I might try to debug and create a PR to resolve this issue next weekend if someone else haven't had time to fix it before that 🙃 |
I also ran into the same issue. Running As a temporary workaround, I created a symlink in the CWD with which worked for me
|
@owenvoke the issue occurs in
In fact, the I dug deeper and found out that the
It works if you add this line before
So it seems that And this is probably linked with PHP8.3 and this link could possibly be the reason. |
Thanks for all the comments on this thread! I was able to unblock my build by using this workaround, thank you @SamuelMwangiW
|
Hello!!
I'm currently facing an issue while trying to build the a
phar
.This is the error that I'm getting:
I faced this issue with an existing project but I also face this problem if I start a brand new project following the installation instructions.
Things that I have tried:
box.json
file exists and is present on the projectphp
) torequire-dev
My guess is that I'm missing something in the setup piece, but I followed the available documentation, if there is a gap in the installation guide I'm happy to raise a PR once I get this to work.
Any guidance?
Thanks!!1
The text was updated successfully, but these errors were encountered: