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

Call to a member function url() on null #99

Open
kyranb opened this issue Jun 6, 2022 · 5 comments
Open

Call to a member function url() on null #99

kyranb opened this issue Jun 6, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@kyranb
Copy link

kyranb commented Jun 6, 2022

Running PHP 7.4.29 (cli) (built: Apr 14 2022 11:36:10) ( NTS )

php please ssg:generate outputs the following:


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▕     {

      +27 vendor frames
  28  [internal]:0
      Statamic\Stache\Indexes\Value::Statamic\Stache\Indexes\{closure}(Object(Statamic\Entries\Entry), "1845791e-ed19-4114-a585-fb2ae1905e9b")

      +7 vendor frames
  36  [internal]:0
      Statamic\Stache\Query\EntryQueryBuilder::Statamic\Stache\Query\{closure}("blog")
      
     ```
     
     
     Note:
     
     I have a `blog` collection and a `blog` page within the `pages` collection.
     
     
     
@kyranb
Copy link
Author

kyranb commented Jun 27, 2022

Was able to solve this by calling php please stache:warm before php please ssg:generate.

Not quite sure why that became required all of a sudden as my installation didn't require it in the past? 🤔

@globalexport
Copy link

My ssg generation ran into the same error today (statamic v3.17 & ssg v1.0.1, php 8, parallel mode).

@bradfloodx
Copy link

Thanks @kyranb this helped me too. And I agree, I didn't need this before. Every month I do an SSG deployment and for the last few months I've had some SSG bug or issue to resolve before it will build successfully. Thinking SSG needs some TLC to keep up to date with all the awesome changes happening in Statamic core.

@bradfloodx
Copy link

bradfloodx commented Oct 19, 2022

This is still an issue on

        "statamic/cms": "3.3.45",
        "statamic/ssg": "^1.2",

even with:
php artisan cache:clear && php please glide:clear && php please ssg:generate

@ajp
Copy link

ajp commented Jan 30, 2023

Ran into this issue today.
Was able to solve with @kyranb's solution to please stache:warm first before please ssg:generate

@duncanmcclean duncanmcclean added the bug Something isn't working label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants