FakerPress & Acorn 3

Hi there,

When developing a new site locally, I use FakerPress a lot to generate dummy content to test long post titles, content, pagination etc.

This used to work fine when installing & activating with composer, but since I updated to Acorn 3, I’m getting this error when activating the plugin:

Skipping provider [Carbon\Laravel\ServiceProvider] because it requires a dependency that cannot be found.

Here’s my full error stack.
I can see the plugin uses Carbon, but I don’t really understand the root of this problem… What does Acorn have to do with this? Plugins should work as standalone applications right?

Is there a way to fix this error?

Hi @Twansparant,

If everything is working as expected, I think you can safely ignore this.

Acorn iterates over Laravel ServiceProviders and attempts to load them. A Laravel ServiceProvider is bundled as part of nesbot/carbon.

I believe this error is thrown simply because Acorn is being smart about trying to boot the Carbon ServiceProvider, but associated dependencies aren’t installed.

You should be able to selectively disable auto-discovery of of a service provider by adding something like this to your composer.json:

"extra": {
    "laravel": {
        "dont-discover": [
            "nesbot/carbon"
        ]
    }
},

That’s all untested, but hopefully points in the right direction!

3 Likes

Hi @talss89, thanks for your reply!
That’s just the thing, the whole backend is not working anymore when I activate the plugin. I only get the error screen on each admin page.

I tried what you suggested by editing my composer file but that did not fix it unfortunately…

Any other thoughts?
Thanks!

1 Like

Somehow I made it work by running:

wp @development acorn package:discover

Activating the plugin doesn’t throw an error now! :tada:

2 Likes

Brilliant, thanks for sharing - that’s useful to know!

Did you retain the extra.laravel props in composer.json? Or were you able to remove that?

Sorry for my late reply, I was able to remove the extra.laravel props yes, running wp @development acorn package:discover was enough!