Skip to content
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

Installing produces PHP Fatal Error #102

Closed
thomaslanenh opened this issue Dec 29, 2021 · 23 comments
Closed

Installing produces PHP Fatal Error #102

thomaslanenh opened this issue Dec 29, 2021 · 23 comments

Comments

@thomaslanenh
Copy link

thomaslanenh commented Dec 29, 2021

PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace: #0 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...') #1 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Illuminate\\Cont...') #2 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array, true) #3 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(694): Illuminate\Foundation\Application->resolve('Illuminate\\Cont...', Array) #4 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('Illuminate\\Cont...', Array) #5 /app/wp in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php on line 1093 Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace: #0 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...') #1 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Illuminate\\Cont...') #2 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array, true) #3 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(694): Illuminate\Foundation\Application->resolve('Illuminate\\Cont...', Array) #4 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('Illuminate\\Cont...', Array) #5 /app/wp in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php on line 1093

Attempted to follow the set up guide but any

wp acorn acf:field Example

commands run produce this error.

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

can you try beta.7 of acorn?

@thomaslanenh
Copy link
Author

Same error(s) unfortunately :( Unless I updated to the beta revision wrong.

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

Can you try clearing the wp-content/cache/acorn directory? (after upgrading to beta.7)

@thomaslanenh
Copy link
Author

Hmmm, I don't actually have a wp-content/cache folder. Maybe therein lies the issue?

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

yea, sage/acorn beta is all over the place the past month.

how about in themes/sage/storage/framework/cache?

delete packages.php and services.php and then wp acorn optimize and then try doing a field again

@thomaslanenh
Copy link
Author

So I tried that and I think it provided a different error now...a critical one rip. Thanks for your help btw.

PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace: #0 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...') #1 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Illuminate\\Cont...') #2 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array, true) #3 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(694): Illuminate\Foundation\Application->resolve('Illuminate\\Cont...', Array) #4 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('Illuminate\\Cont...', Array) #5 /app/wp in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php on line 1093 Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php:1093 Stack trace: #0 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(886): Illuminate\Container\Container->notInstantiable('Illuminate\\Cont...') #1 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Illuminate\\Cont...') #2 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->resolve('Illuminate\\Cont...', Array, true) #3 /app/wp-content/themes/sage/vendor/illuminate/container/Container.php(694): Illuminate\Foundation\Application->resolve('Illuminate\\Cont...', Array) #4 /app/wp-content/themes/sage/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(826): Illuminate\Container\Container->make('Illuminate\\Cont...', Array) #5 /app/wp in /app/wp-content/themes/sage/vendor/illuminate/container/Container.php on line 1093 Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

does wp acorn optimize:clear work or is the CLI broken entirely?

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

how old is your project? can you update it to have parity with the latest sage 10? have you customized your sage 10 configs? if so can you delete them all so it has parity with dev-main

@thomaslanenh
Copy link
Author

It works. Interestingly, the acf actions now appear when you do wp acorn list, which weren't before. But when you try to use one you get a fatal error.

@thomaslanenh
Copy link
Author

From this morning lol. I'll try deleting those and report back in.

@thomaslanenh
Copy link
Author

Okay so...I downloaded Sage 10 beta 2 and overwrote my existing files. That seemed to allow wp acorn acf:field Example to work! But it doesn't actually work. It's getitng me to a problem I had with ACF Builder and Sage 9. It doesn't seem to be actually doing anything. Which I presume makes sense now that ACF composer is working i'm back to my ACF Builder bug?

Thanks

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

thats really strange it wouldn't be working.. are you on the latest ACF Pro? all of the stubs generated should work out of the box (e.g. add a field to Post, or create an example Block)

@thomaslanenh
Copy link
Author

Yep. It does it both for Sage 9 and Sage 10, using Trellis / Bedrock & not using them, which makes me think maybe i missed something. It seems like setup.php just doesn't get run or something? Or does regular ACF need to be installed in addition to Pro?

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

nope just pro and make sure its activated of course. you don't have to do anything special. 😕

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

can you try an options page? or a block? nothing works?

@thomaslanenh
Copy link
Author

thomaslanenh commented Dec 29, 2021

That's the odd thing; it gets created but nothing gets reflected on the actual site. :(

So:

`www-data@3f8e438a1783:/app$ wp acorn acf:block TestBlock

🎉 TestBlock block successfully composed.
⮑ app/Blocks/TestBlock.php
⮑ resources/views/blocks/test-block.blade.php`

 app/blocks/TestBlock.php produces:
 `<?php

namespace App\Blocks;

use Log1x\AcfComposer\Block;
use StoutLogic\AcfBuilder\FieldsBuilder;

class TestBlock extends Block
{
/**
* The block name.
*
* @var string
*/
public $name = 'Test Block';

/**
 * The block description.
 *
 * @var string
 */
public $description = 'A simple Test Block block.';

/**
 * The block category.
 *
 * @var string
 */
public $category = 'formatting';

/**
 * The block icon.
 *
 * @var string|array
 */
public $icon = 'editor-ul';

/**
 * The block keywords.
 *
 * @var array
 */
public $keywords = [];

/**
 * The block post type allow list.
 *
 * @var array
 */
public $post_types = [];

/**
 * The parent block type allow list.
 *
 * @var array
 */
public $parent = [];

/**
 * The default block mode.
 *
 * @var string
 */
public $mode = 'preview';

/**
 * The default block alignment.
 *
 * @var string
 */
public $align = '';

/**
 * The default block text alignment.
 *
 * @var string
 */
public $align_text = '';

/**
 * The default block content alignment.
 *
 * @var string
 */
public $align_content = '';

/**
 * The supported block features.
 *
 * @var array
 */
public $supports = [
    'align' => true,
    'align_text' => false,
    'align_content' => false,
    'full_height' => false,
    'anchor' => false,
    'mode' => false,
    'multiple' => true,
    'jsx' => true,
];

/**
 * The block styles.
 *
 * @var array
 */
public $styles = [
    [
        'name' => 'light',
        'label' => 'Light',
        'isDefault' => true,
    ],
    [
        'name' => 'dark',
        'label' => 'Dark',
    ]
];

/**
 * The block preview example data.
 *
 * @var array
 */
public $example = [
    'items' => [
        ['item' => 'Item one'],
        ['item' => 'Item two'],
        ['item' => 'Item three'],
    ],
];

/**
 * Data to be passed to the block before rendering.
 *
 * @return array
 */
public function with()
{
    return [
        'items' => $this->items(),
    ];
}

/**
 * The block field group.
 *
 * @return array
 */
public function fields()
{
    $testBlock = new FieldsBuilder('test_block');

    $testBlock
        ->addRepeater('items')
            ->addText('item')
        ->endRepeater();

    return $testBlock->build();
}

/**
 * Return the items field.
 *
 * @return array
 */
public function items()
{
    return get_field('items') ?: $this->example['items'];
}

/**
 * Assets to be enqueued when rendering the block.
 *
 * @return void
 */
public function enqueue()
{
    //
}

}
`

and views.../TestBlock.php produces:
`


@if ($items)

@else

{{ $block->preview ? 'Add an item...' : 'No items found!' }}


@endif

`

But nothing appears on the site. It's very odd. ACF Builder I was having the same issue with both Sage 9 and Sage 10 in that it wouldn't actually do anything after setting it up. If I try to reinstall ACF Builder now though I get:

`composer require stoutlogic/acf-builder --with-all-dependencies
Using version ^1.12 for stoutlogic/acf-builder
./composer.json has been updated
Running composer update stoutlogic/acf-builder --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires roots/acorn v2.0.0-beta.6, found roots/acorn[v2.0.0-beta.6] but the package is fixed to v2.0.0-beta.7 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require stoutlogic/acf-builder:*" to figure out if any version is installable, or "composer require stoutlogic/acf-builder:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
`

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

does anything related to ACF work in your environment? can you use get_field('test') or does it throw the function not existing? is it showing up in the backend? the above error is just composer being dumb. try running composer upgrade first - but regardless, you don't need to bring in acf-builder. acf-composer already does.

@thomaslanenh
Copy link
Author

So, interesting, that block i created worked! So it just seems anything involving the FieldBuilder that isn't a Block related doens't for some odd reason? Like I can even see the Item repeater in the test block but not in the field, unless i'm being a idiot and not looking in the right area (which is totally possible lol)

@thomaslanenh
Copy link
Author

thomaslanenh commented Dec 29, 2021

edit: I got it back, somehow acf composer got uninstalled; above error still applies

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

on a fresh Bedrock & Sage 10 install I get my test field at the bottom of the block editor:

Screenshot

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

Does the field show up in Gutenberg Preferences (Top right Gear -> Preferences)?

Screenshot

@thomaslanenh
Copy link
Author

Woah, it just randomly started working after it uninstalled itself and I reinstalled it. I don't know what caused that to make it kick in and work but thank you for all the help. If there's anything I can send you to help asisst if this is a repeatable issue.

@Log1x
Copy link
Owner

Log1x commented Dec 29, 2021

glad you got it working! sounds like some dependency hell or something weird with caching. Acorn might've played a part in this (at least on Sage 10) but will be fixed in beta 8 or 9 in entirety.

@Log1x Log1x closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants