tinkerwell-helper icon indicating copy to clipboard operation
tinkerwell-helper copied to clipboard

Undefined variable $output

Open vmiguellima opened this issue 2 years ago • 2 comments

Steps to Reproduce:

use App\Models\User;

User::first();

An run the code above.

It Returns:

$array = [
    'Error' => '
   ErrorException 

  Undefined variable $output

  at phar:///Applications/Tinkerwell.app/Contents/Resources/tinkerwell/tinker.phar/src/Actions/TableAction.php:38
     34▕         $values = \_PhpScoperc223a629f245\Tinkerwell\Shell\CustomExecutionLoopClosure::getLastReturnValue();
     35▕         if (\is_iterable($values)) {
     36▕             return $this->outputTable($values);
     37▕         }
  ➜  38▕         $outputCode = $output->fetch();
     39▕         $outputCode = \preg_replace('/phar:\\/\\/(.*)\\n?/m', '', $outputCode);
     40▕         echo \json_encode(['error' => \trim($outputCode), 'keys' => [], 'data' => []]);
     41▕     }
     42▕     protected function outputTable($values)

  1   phar:///Applications/Tinkerwell.app/Contents/Resources/tinkerwell/tinker.phar/src/Actions/TableAction.php:38
      Illuminate\Foundation\Bootstrap\HandleExceptions::Illuminate\Foundation\Bootstrap\{closure}("Undefined variable $output", "phar:///Applications/Tinkerwell.app/Contents/Resources/tinkerwell/tinker.phar/src/Actions/TableAction.php")

  2   phar:///Applications/Tinkerwell.app/Contents/Resources/tinkerwell/tinker.phar/src/ActionInvoker.php:19
      _PhpScoperc223a629f245\Tinkerwell\Actions\TableAction::execute()
',
];

vmiguellima avatar May 20 '22 09:05 vmiguellima

Same here:

$array = [
    'Error' => '
   ErrorException 

  Undefined variable $output

  at phar:///tmp/.mount_TinkeryANIQK/resources/tinkerwell/tinker.phar/src/Actions/TableAction.php:38
     34▕         $values = \_PhpScoperc223a629f245\Tinkerwell\Shell\CustomExecutionLoopClosure::getLastReturnValue();
     35▕         if (\is_iterable($values)) {
     36▕             return $this->outputTable($values);
     37▕         }
  ➜  38▕         $outputCode = $output->fetch();
     39▕         $outputCode = \preg_replace('/phar:\\/\\/(.*)\\n?/m', '', $outputCode);
     40▕         echo \json_encode(['error' => \trim($outputCode), 'keys' => [], 'data' => []]);
     41▕     }
     42▕     protected function outputTable($values)

  1   phar:///tmp/.mount_TinkeryANIQK/resources/tinkerwell/tinker.phar/src/Actions/TableAction.php:38
      Illuminate\Foundation\Bootstrap\HandleExceptions::Illuminate\Foundation\Bootstrap\{closure}()

  2   phar:///tmp/.mount_TinkeryANIQK/resources/tinkerwell/tinker.phar/src/ActionInvoker.php:19
      _PhpScoperc223a629f245\Tinkerwell\Actions\TableAction::execute()
',
];

mcaif avatar Jun 23 '22 16:06 mcaif

Have you found a solution to the problem? I get this error after migrating to a new Mac with Apple Silicon and installing the app for apple silicon again.

edit Deleting the application with AppCleaner (which finds all files a program installs on macOS) and reinstalling it solved the issue.

michaelklopf avatar Jan 05 '23 21:01 michaelklopf