René's URL Explorer Experiment


Title: `run` / `wait` can get stuck when using Next.js with App Router · Issue #136 · replicate/replicate-javascript · GitHub

Open Graph Title: `run` / `wait` can get stuck when using Next.js with App Router · Issue #136 · replicate/replicate-javascript

X Title: `run` / `wait` can get stuck when using Next.js with App Router · Issue #136 · replicate/replicate-javascript

Description: At yesterday's hackathon, a participant shared that predictions created and polled for completion using run would hang indefinitely, despite the Replicate dashboard showing that prediction as finishing minutes earlier. After debugging by...

Open Graph Description: At yesterday's hackathon, a participant shared that predictions created and polled for completion using run would hang indefinitely, despite the Replicate dashboard showing that prediction as finis...

X Description: At yesterday's hackathon, a participant shared that predictions created and polled for completion using run would hang indefinitely, despite the Replicate dashboard showing that prediction as f...

Opengraph URL: https://github.com/replicate/replicate-javascript/issues/136

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`run` / `wait` can get stuck when using Next.js with App Router ","articleBody":"At yesterday's hackathon, a participant shared that predictions created and polled for completion using `run` would hang indefinitely, despite the Replicate dashboard showing that prediction as finishing minutes earlier.\r\n\r\nAfter debugging by adding a `console.log` statement in the `progress` callback function, we determined that this behavior was caused by the extensions to `fetch` made by Next.js when using App Router [^1]. From [\"Data Fetching, Caching, and Revalidating\"](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating) in the Next.js docs:\r\n\r\n\u003e Next.js extends the native [fetch Web API](https://developer.mozilla.org/docs/Web/API/Fetch_API) to allow you to configure the [caching](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#caching-data) and [revalidating](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#revalidating-data) behavior for each fetch request on the server. React extends fetch to automatically [memoize](https://nextjs.org/docs/app/building-your-application/data-fetching/patterns#fetching-data-where-its-needed) fetch requests while rendering a React component tree.\r\n\u003e ...\r\n\u003e By default, **Next.js automatically caches the returned values of fetch in the [Data Cache](https://nextjs.org/docs/app/building-your-application/caching#data-cache)** on the server. This means that the data can be fetched at build time or request time, cached, and reused on each data request.\r\n\r\nBecause the initial `GET /v1/predictions/{id}` response was cached, subsequent requests polling for status returned the same response, which had the initial `\"starting\"` status.\r\n\r\nOur workaround involved setting `replicate.fetch` to a wrapped function that specified a [`cache: no-store` fetch option](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionscache). But it's unclear whether there's a better way to get the desired behavior.\r\n\r\nWe should either document or add a workaround to make this work correctly in Next.js.\r\n\r\n[^1]: `fetch` when using [Pages Router](https://nextjs.org/docs/pages/building-your-application), like in the [\"Build a website with Next.js\"](https://replicate.com/docs/get-started/nextjs) sample project, works as expected.","author":{"url":"https://github.com/mattt","@type":"Person","name":"mattt"},"datePublished":"2023-09-18T13:20:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/136/replicate-javascript/issues/136"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:89f6af4e-a0c4-af98-e880-f121a6360c21
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCBE6:2D3E84:275DA99:362EA03:6964E00B
html-safe-nonce11fe52f8226de3ed3618cf43abe10e79dbbbf5070506ff80b6accf3aab3d80ad
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkU2OjJEM0U4NDoyNzVEQTk5OjM2MkVBMDM6Njk2NEUwMEIiLCJ2aXNpdG9yX2lkIjoiNjk1NDQ0MzE2NTIxNjg1ODEyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb7dc2a2978a1182ff546802c586f17b1d8690ee885a4b1ce1876be215d842195
hovercard-subject-tagissue:1900930405
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/replicate/replicate-javascript/136/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5b1fb24fc07fc99ae6c6912c486d357893c5a62148b6e69f75bd8483000fbf3f/replicate/replicate-javascript/issues/136
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5b1fb24fc07fc99ae6c6912c486d357893c5a62148b6e69f75bd8483000fbf3f/replicate/replicate-javascript/issues/136
og:image:altAt yesterday's hackathon, a participant shared that predictions created and polled for completion using run would hang indefinitely, despite the Replicate dashboard showing that prediction as finis...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemattt
hostnamegithub.com
expected-hostnamegithub.com
None5838582163a1256e5ebd5086b7e1dc5cea93d82086c9c8b1395fb50f6ddab28d
turbo-cache-controlno-preview
go-importgithub.com/replicate/replicate-javascript git https://github.com/replicate/replicate-javascript.git
octolytics-dimension-user_id60410876
octolytics-dimension-user_loginreplicate
octolytics-dimension-repository_id567870467
octolytics-dimension-repository_nworeplicate/replicate-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id567870467
octolytics-dimension-repository_network_root_nworeplicate/replicate-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8edad3509fd3b4374694551987974bbbcfd316c0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/replicate/replicate-javascript/issues/136#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Freplicate%2Freplicate-javascript%2Fissues%2F136
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Freplicate%2Freplicate-javascript%2Fissues%2F136
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=replicate%2Freplicate-javascript
Reloadhttps://github.com/replicate/replicate-javascript/issues/136
Reloadhttps://github.com/replicate/replicate-javascript/issues/136
Reloadhttps://github.com/replicate/replicate-javascript/issues/136
replicate https://github.com/replicate
replicate-javascripthttps://github.com/replicate/replicate-javascript
Notifications https://github.com/login?return_to=%2Freplicate%2Freplicate-javascript
Fork 241 https://github.com/login?return_to=%2Freplicate%2Freplicate-javascript
Star 590 https://github.com/login?return_to=%2Freplicate%2Freplicate-javascript
Code https://github.com/replicate/replicate-javascript
Issues 6 https://github.com/replicate/replicate-javascript/issues
Pull requests 4 https://github.com/replicate/replicate-javascript/pulls
Actions https://github.com/replicate/replicate-javascript/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/replicate/replicate-javascript/security
Please reload this pagehttps://github.com/replicate/replicate-javascript/issues/136
Insights https://github.com/replicate/replicate-javascript/pulse
Code https://github.com/replicate/replicate-javascript
Issues https://github.com/replicate/replicate-javascript/issues
Pull requests https://github.com/replicate/replicate-javascript/pulls
Actions https://github.com/replicate/replicate-javascript/actions
Security https://github.com/replicate/replicate-javascript/security
Insights https://github.com/replicate/replicate-javascript/pulse
New issuehttps://github.com/login?return_to=https://github.com/replicate/replicate-javascript/issues/136
New issuehttps://github.com/login?return_to=https://github.com/replicate/replicate-javascript/issues/136
#264https://github.com/replicate/replicate-javascript/pull/264
run / wait can get stuck when using Next.js with App Router https://github.com/replicate/replicate-javascript/issues/136#top
#264https://github.com/replicate/replicate-javascript/pull/264
https://github.com/mattt
https://github.com/mattt
mattthttps://github.com/mattt
on Sep 18, 2023https://github.com/replicate/replicate-javascript/issues/136#issue-1900930405
1https://github.com/replicate/replicate-javascript/issues/136#user-content-fn-1-767d59873a57189e60af9f5ed7aede82
"Data Fetching, Caching, and Revalidating"https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating
fetch Web APIhttps://developer.mozilla.org/docs/Web/API/Fetch_API
cachinghttps://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#caching-data
revalidatinghttps://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating#revalidating-data
memoizehttps://nextjs.org/docs/app/building-your-application/data-fetching/patterns#fetching-data-where-its-needed
Data Cachehttps://nextjs.org/docs/app/building-your-application/caching#data-cache
cache: no-store fetch optionhttps://nextjs.org/docs/app/building-your-application/caching#fetch-optionscache
Pages Routerhttps://nextjs.org/docs/pages/building-your-application
"Build a website with Next.js"https://replicate.com/docs/get-started/nextjs
https://github.com/replicate/replicate-javascript/issues/136#user-content-fnref-1-767d59873a57189e60af9f5ed7aede82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.