chris.violette
Explore posts from serversCDCloudflare Developers
•Created by chris.violette on 8/22/2024 in #pages-help
Error: Failed to publish your Function. Got error: Unknown internal error occurred.
Today I have been receiving the error "Error: Failed to publish your Function. Got error: Unknown internal error occurred." at the end of the log when attempting new Cloudflare Pages branch preview deploys of a Nuxt 3 site.
This has happened both on a branch with new updates, as well as when attempting to redeploy an unchanged branch I know was successful yesterday.
- First failed deploy ID (changed branch): 40f8d806-dc76-47f2-aecb-eb89010d18f6
- Unchanged branch failed deploy ID: 58e7b43b-0c4b-4bc7-9e5c-feb10689bb90
- Previously successful deploy ID: bbe09ac1-e190-40c0-a89e-3cee30376c33
https://poetryfoundation-fe.pages.dev/
0f9ad129f3922da4c105e565be3ae6d8
8 replies
Adding query strings to Apollo GraphQL requests
I am working on a Nuxt 3 site using the Nuxt Apollo (https://apollo.nuxtjs.org/) GraphQL module. This is set up to query the backend (Craft CMS) for content and so far has been working well.
I am now trying to get live previews working. From the Craft CMS side, when a user tries to preview changes, it adds a
token=abc123
query string to the entry URL. This token should then be added to posts to the GraphQL API endpoint to allow querying for draft content.
The issue I'm running into is how to hand off that token
parameter from the initial GET
request, if it exists, to the Apollo client.
For client-side requests, I've been proxying the GraphQL endpoint through an /api/graphql
Nuxt server route, forwarding the request on to the 3rd party server. Doing that, I've been able to modify the endpoint URL with that token. However, I have not figured out how I can do the same for server-side requests, as they go directly to the 3rd-party endpoint.
Relative URLs don't appear to work with the Apollo module for SSR (https://github.com/nuxt-modules/apollo/issues/610), so I haven't been able to figure out how I could intercept/modify/proxy those requests the same as I do for client-side queries.
Any ideas would be welcome. I feel like I'm very close to solving, but with most of the data fetched server-side, I need to make it work with those requests.1 replies