Giter Site home page Giter Site logo

Vercel ISR error about next-cms-ghost HOT 18 CLOSED

styxlab avatar styxlab commented on May 17, 2024
Vercel ISR error

from next-cms-ghost.

Comments (18)

styxlab avatar styxlab commented on May 17, 2024

@imtoanle : Welcome to this project! Judging from the error message it looks like an error in the ISR feature. The problem seems to be that whenever a new page is ISR generated with previously unknown images, those images are auto-analyzed and the meta-info is written to the file-system cache. However, the file-system cache can only be written during deploy, after that it is only readable.

Until I have found a fix, you have the following workaround options available, you may want to disable one of the following features in appConfig.js.

  • disable ISR
  • disable image optimization (nextFeatureImages and nextInlineImage)
  • disable fileCache

The last option is probably best option at hand. Going forward, I most likely need to disable the fileCache writes on ISR.

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab It makes sense. Thanks for your explanation
Thank again for your amazing works in this project.

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

Can you please test ISR with the latest version again? The error should be fixed.

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab I saw your exception mession in log. But request still returned 502 error.
Screen Shot 2021-02-14 at 21 57 15
Screen Shot 2021-02-14 at 21 57 27

This function loaded > 10 seconds so it was killed by Vercel
https://comoex.com/_next/data/mMB3xKBb_vitRw_92p4yU/hop-dong-ky-han-va-hop-dong-tuong-lai-la-gi.json

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab I found the reason.
When i fast scroll my home page to end. https://comoex.com
Homepage already rendered all 170 posts. So Next loaded 170 jsons and caused overload issue.
Vercel told > 10 seconds for handle request.

Screen Shot 2021-02-14 at 15 40 56

Do we have feature to limit 10->20 posts in home page / tag page ?

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab I could limit home page posts by add limit value to getAllPosts in pages/index.tsx.
I think infinite scroll here is better. Could we implement this ?

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

Before going into solution mode, I would like to understand your requirements better. How many posts does your site have? Is this a problem after initial deploy, does it occur only on the index page, does it go away after a while or does it persist?

There is also a maxNumberOfPost option available as part of the ISR feature but it does not affect the index page.

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab My site have total 170 posts. All of them were rendered in home page and tag page.
When i scroll this page. Next js will fetch json data foreach post.

Vercel will be slowed when handle many requests at the same time and they limited 10 seconds for "Serverless Function Execution Timeout (Seconds)". See: https://vercel.com/docs/platform/limits
So json request got 502 error.

This issue always happen on a site has many posts.
Eg: https://comoex.com/tag/tai-lieu

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

Thanks for the info, I know these limits but still don't understand why you run into them. Could you please publish

  1. your appConfig.js settings (only the ones that deviate from the default settings)
  2. publish your Ghost CMS keys, so I can test your site myself (you can create new keys that you can delete afterwards).
  3. Does this only happen with ISR? What happens when you disable ISR?

I also don't see any issues when scrolling your site at https://comoex.com/tag/tai-lieu, but maybe some posts are missing there?

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

@imtoanle: Are you still interested in keeping this thread open or did you find a solution in the meantime?

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab Sorry. I came back, i got busy few days ago.
The first your fix resolved file cache issue.

Regarding to timed out issue. Please see video https://recordit.co/uGP45cax8M
Version: https://comoex-next-theme-3s9rk1902.vercel.app/tag/tai-lieu
It's working if disable ISR feature

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

@imtoanle: No problem. Could you publish (temporary) keys, so I can test the site locally? I also notice that you are using a modified version for page navigation.

About the timeouts. Even if you run into them, shouldn't they go away after a while as all sites are regenerated? Still a porblem, I know, but of lesser degree if it's only temporary.

Also: Did you contact Vercel about this? I may find some ways to load less data, but the root cause is infrastructure related.

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab Sure. I tried to add pagination to avoid this issue but it didn't work.
After fast scroll throught 3 pages or just one page in original version. ISR called many serverless requests in queue and they're timed out (just my guess).

My key

Content API key: b665df815928ee25f9643ca50f
API URL: https://cms.comoex.com

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

I already get timeouts during local building (yarn build):

image

You should first look into your Ghost CMS, you may have to lift access limits there. Look into the rate limits in your Ghost config.

Apart from Ghost CMS, ETIMEDOUT may also indicate problems with the hosting provider where you Ghost CMS is residing. The errors on Vercel may just be a result of not being able to fetch the data from your Ghost CMS.

This would make much more sense, because ISR issues should be temporary and vanish, once a site has been re-generated for the first time.

from next-cms-ghost.

imtoanle avatar imtoanle commented on May 17, 2024

@styxlab Thanks! really appreciate your advice.
I 'll have a look and feedback to you soon

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

@all-contributors please add @imtoanle for bug

from next-cms-ghost.

allcontributors avatar allcontributors commented on May 17, 2024

@styxlab

I've put up a pull request to add @imtoanle! 🎉

from next-cms-ghost.

styxlab avatar styxlab commented on May 17, 2024

Closing as inactive. Can be re-opened anytime.

from next-cms-ghost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.