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

Statamic SSG - Call to a member function url() on null #167

Open
brad-sf opened this issue Jan 24, 2024 · 5 comments
Open

Statamic SSG - Call to a member function url() on null #167

brad-sf opened this issue Jan 24, 2024 · 5 comments

Comments

@brad-sf
Copy link

brad-sf commented Jan 24, 2024

Running php please ssg:generate --verbose with withcandour/[email protected] and statamic/[email protected] and statamic/[email protected] gives me:

Gathering content to be generated...

   Error

  Call to a member function url() on null

  at vendor/statamic/ssg/src/Request.php:51
     47▕     }
     48▕
     49▕     public function getPathInfo(): string
     50▕     {
  ➜  51▕         return $this->page->url();
     52▕     }
     53▕
     54▕     public function path()
     55▕     {

  1   vendor/symfony/http-foundation/Request.php:1022
      Statamic\StaticSite\Request::getPathInfo()

  2   vendor/laravel/framework/src/Illuminate/Http/Request.php:108
      Symfony\Component\HttpFoundation\Request::getUri()

  3   vendor/withcandour/aardvark-seo/src/Listeners/AppendEntrySeoFieldsListener.php:20
      Illuminate\Http\Request::url()

  4   vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:441
      WithCandour\AardvarkSeo\Listeners\AppendEntrySeoFieldsListener::handle(Object(Statamic\Events\EntryBlueprintFound))

Perhaps this is related to statamic/ssg#134 ?

Is anyone at Candour using SSG with Statamic V4?

@brad-sf
Copy link
Author

brad-sf commented Jan 24, 2024

In statamic v3 I could get around this error sometimes by doing please stache:warm but not anymore with v4.

@brad-sf
Copy link
Author

brad-sf commented Jan 24, 2024

I'm not sure how to help further. I'm not great with PHP. Anything else I can do to help?

@brad-sf
Copy link
Author

brad-sf commented Feb 7, 2024

@AndrewHaine any thoughts? Thanks bro!

@brad-sf
Copy link
Author

brad-sf commented Feb 7, 2024

By the way if I composer remove withcandour/aardvark-seo the SSG site builds fine. It only fails with the above error when withcandour/aardvark-seo is added.

@CandourDevs
Copy link

@brad-sf Hi. Sorry about your difficulties. We were able to run php please ssg:generate on the latest versions of Statamic and Aardvark without a problem. We recommend updating your versions, if you are able, and giving it another try.

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