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

Static generation does not render some breadcrumb segments #174

Open
markzegarelli opened this issue Jul 25, 2024 · 5 comments
Open

Static generation does not render some breadcrumb segments #174

markzegarelli opened this issue Jul 25, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@markzegarelli
Copy link

We're using SSG for the production deployment of our site, and working locally in the standard, non-static mode.

I've noticed there are sections of our site in which the last part of breadcrumb doesn't render. Example here. Production builds run on Vercel, following the instructions in your docs.

The same page running locally displays the breadcrumb as expected.
Screenshot 2024-07-25 at 10 16 38 AM

Environment
Application Name: Amplitude Documentation
Laravel Version: 10.40.0
PHP Version: 8.2.16
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: amplitude-docs.test/docs
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 2
Sites: 2 (Amplitude Documentation, Amplitude Documentation - Japanese)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.3.0 PRO

Statamic Addons
pecotamic/sitemap: 1.4.7
statamic/ssg: 3.0.0
@duncanmcclean duncanmcclean added the bug Something isn't working label Jul 25, 2024
@markzegarelli
Copy link
Author

This is still an issue for us. This issue seems to happen on some collections, but not others, and is happening more often.

We don't see any errors in the SSG output, and have updated Statamic to 5.31.0 and SSG to 3.0.2.

Additionally, running ssg locally on my machine produces no breadcrumbs at all.

@jesseleite
Copy link
Member

Additionally, running ssg locally on my machine produces no breadcrumbs at all.

Hmm, I pulled down your repo and was able to generate breadcrumbs locally on your site fine 🤔

CleanShot 2024-12-06 at 16 53 06

That said, I'm on PHP 8.3. I suspect it may have more to do with how you're configuring your .env and deploying your /docs.

For example, I was getting 404s on nested pages until I tweaked APP_URL in my .env, from what you had in your .env.example:

APP_URL=http://amplitude-docs.test/docs

Which I had to change to:

APP_URL=http://amplitude-docs.test/

I'm curious to know more about what you have set for that in your .env locally, versus where you're running ssg:generate for production?

This issue seems to happen on some collections, but not others, and is happening more often.

If you take a collection or page that doesn't render properly, does it consistently not work across multiple generations? Or is there a randomness to when it does or doesn't work, on a specific page?

@markzegarelli
Copy link
Author

Thanks for the response @jesseleite!

I was able to reproduce your results locally, which is awesome. I think I had included /docs in the APP_URL when using Vite, but obviously don't need that anymore.

I tried to replicate this setting in Vercel for our production build, APP_URL=https://amplitude.com, but it didn't seem to help. For example, here's the page from the screenshot.

@jesseleite
Copy link
Member

@markzegarelli Hmm, assuming everything is working as expected locally, I'd need to know more details on your vercel env/config.

I can try playing with a vercel deployment next week as well.

@markzegarelli
Copy link
Author

Sure, here's the build script.

Let me know what other details will be helpful for you.

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

3 participants