-
Notifications
You must be signed in to change notification settings - Fork 337
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
🐛 BUG: The cache field on RequestInitializerDict is not implemented in fetch #698
Comments
@dgraham Downgrading to 1.6.0 seems to be a solution for now. Will be watching this space and planetscale/database-js#102 for a solution which will work with latest version too, FYI. Thanks. |
Same issue |
@dgraham — we're going to address this, just a matter of timing. Should know more specifics soon. |
Still seeing this:
Any workaround till this attr is implemented? |
@ignoramous if ur using planetscale planetscale/database-js#102 (comment) |
I have same error with upstash redis db
|
@satpalsr upstash redis should have fixed this issue |
I was using @upstash/redis, it's working with @upstash/redis/cloudflare. Thanks |
Any update on this? I am still seeing The 'cache' field on 'RequestInitializerDict' is not implementederror when using latest @planetscale/database. Any workaround suggestions are appreciated. Thanks! |
@trd-sys There is a workaround in planetscale/database-js#102 (comment) |
Hope this bugs will solved in features soon 😆 |
Any update? |
Adding the below to my config fixed the issue for my worker: The delete cache part of the config seems to fix. |
The |
I got the same issue on production w/ lucia |
Trying to use the cloudflare worker with the planet scale and Drizzle ORM Error: The 'cache' field on 'RequestInitializerDict' is not implemented. |
Starting to get close to the "Fast Origin Transfer" limit on Vercel for what I believe is the S3 proxy for save files. I don't believe it is the bandwidth from Cloudflare (which underpins Vercel's edge runtime) to Backblaze B2 (the S3 provider) as they are partners in the bandwidth alliance, but rather the bandwidth from the edge runtime to the user. Considering I'd like to keep a reverse proxy in front of S3 for the flexibility, Vercel is starting to look limiting. This commit changes the deployment to cloudflare pages. The following changes were needed: - Remove `no-store` from the fetch cache as cloudflare doesn't support it. cloudflare/workerd#698 Makes me question if Vercel's edge runtime actually runs on Cloudflare. `no-store` may not have been critical either. - A patch was needed for `next-on-pages` to allow our split deployment with latent nodejs functions to be considered valid. - `_routes.json` is added so that only api functions are counted as function executions. Otherwise users accessing docs or index.html (in a pure SPA) is counted against the Cloudflare function limit.
Starting to get close to the "Fast Origin Transfer" limit on Vercel for what I believe is the S3 proxy for save files. I don't believe it is the bandwidth from Cloudflare (which underpins Vercel's edge runtime) to Backblaze B2 (the S3 provider) as they are partners in the bandwidth alliance, but rather the bandwidth from the edge runtime to the user. Considering I'd like to keep a reverse proxy in front of S3 for the flexibility, Vercel is starting to look limiting. This commit changes the deployment to cloudflare pages. The following changes were needed: - Remove `no-store` from the fetch cache as cloudflare doesn't support it. cloudflare/workerd#698 Makes me question if Vercel's edge runtime actually runs on Cloudflare. `no-store` may not have been critical either. - A patch was needed for `next-on-pages` to allow our split deployment with latent nodejs functions to be considered valid. - `_routes.json` is added so that only api functions are counted as function executions. Otherwise users accessing docs or index.html (in a pure SPA) is counted against the Cloudflare function limit.
Starting to get close to the "Fast Origin Transfer" limit on Vercel for what I believe is the S3 proxy for save files. I don't believe it is the bandwidth from Cloudflare (which underpins Vercel's edge runtime) to Backblaze B2 (the S3 provider) as they are partners in the bandwidth alliance, but rather the bandwidth from the edge runtime to the user. Considering I'd like to keep a reverse proxy in front of S3 for the flexibility, Vercel is starting to look limiting. This commit changes the deployment to cloudflare pages. The following changes were needed: - Remove `no-store` from the fetch cache as cloudflare doesn't support it. cloudflare/workerd#698 Makes me question if Vercel's edge runtime actually runs on Cloudflare. `no-store` may not have been critical either. - A patch was needed for `next-on-pages` to allow our split deployment with latent nodejs functions to be considered valid. - `_routes.json` is added so that only api functions are counted as function executions. Otherwise users accessing docs or index.html (in a pure SPA) is counted against the Cloudflare function limit.
Starting to get close to the "Fast Origin Transfer" limit on Vercel for what I believe is the S3 proxy for save files. I don't believe it is the bandwidth from Cloudflare (which underpins Vercel's edge runtime) to Backblaze B2 (the S3 provider) as they are partners in the bandwidth alliance, but rather the bandwidth from the edge runtime to the user. Considering I'd like to keep a reverse proxy in front of S3 for the flexibility, Vercel is starting to look limiting. This commit changes the deployment to cloudflare pages. The following changes were needed: - Remove `no-store` from the fetch cache as cloudflare doesn't support it. cloudflare/workerd#698 Makes me question if Vercel's edge runtime actually runs on Cloudflare. `no-store` may not have been critical either. - A patch was needed for `next-on-pages` to allow our split deployment with latent nodejs functions to be considered valid. - `_routes.json` is added so that only api functions are counted as function executions. Otherwise users accessing docs or index.html (in a pure SPA) is counted against the Cloudflare function limit.
we are hitting this error now too running a Next.js + Shopify integration |
since its been a few months, @jasnell can we please get an official update on this? |
* Support cloudflare pages next.js deployment Starting to get close to the "Fast Origin Transfer" limit on Vercel for what I believe is the S3 proxy for save files. I don't believe it is the bandwidth from Cloudflare (which underpins Vercel's edge runtime) to Backblaze B2 (the S3 provider) as they are partners in the bandwidth alliance, but rather the bandwidth from the edge runtime to the user. Considering I'd like to keep a reverse proxy in front of S3 for the flexibility, Vercel is starting to look limiting. This commit changes the deployment to cloudflare pages. The following changes were needed: - Remove `no-store` from the fetch cache as cloudflare doesn't support it. cloudflare/workerd#698 Makes me question if Vercel's edge runtime actually runs on Cloudflare. `no-store` may not have been critical either. - A patch was needed for `next-on-pages` to allow our split deployment with latent nodejs functions to be considered valid. - `_routes.json` is added so that only api functions are counted as function executions. Otherwise users accessing docs or index.html (in a pure SPA) is counted against the Cloudflare function limit.
This works, Thanks |
Hello I am trying to upload images to s3 and ran into this problem. ` // Upload file to S3 Error: The 'cache' field on 'RequestInitializerDict' is not implemented. |
We ran into the same problem when we tried to send a message to AWS Firehose. We fixed it with this code: const firehoseClient = new FirehoseClient({
region: AWS_REGION,
credentials: {
accessKeyId: AWS_ACCESS_KEY_ID,
secretAccessKey: AWS_SECRET_ACCESS_KEY,
},
requestHandler: {
// Cloudflare doesn't support the cache option, so we remove it.
requestInit: () => ({
cache: undefined,
}),
},
}); The general solution is to find a configuration option that lets you disable the |
@aslakhellesoy Thanks dude. This fixed the issue for me. |
This issue started to show up when using const client = new SESClient({
region: AWS_REGION,
credentials: {
accessKeyId: AWS_ACCESS_KEY_ID,
secretAccessKey: AWS_SECRET_ACCESS_KEY
},
requestHandler: {
requestInit() {
return { cache: undefined };
}
}
}); |
This did the trick for me on my Nuxt w/ Nitro server project that's hosted on Cloudflare Pages. Thank you! |
Update: We expect Note: As pointed out by @simmbiote below the actual compat option is: |
Hi @AdityaAtulTewari When I tried |
Yes my apologies, my original comment should have had the snake case variant, not the camel case one. Edit: Docs for more details https://developers.cloudflare.com/workers/configuration/compatibility-flags/#enable-cache-no-store-http-standard-api |
I'm still having this issue, even with the new flags enabled. Getting the error |
We still haven't rolled out support for |
You'll need to update your compatibility date to at least 2024-11-11 (when the flag became active by default) or manually set the |
I've re-created a minimal example here: https://codesandbox.io/p/devbox/ty6x35 If I set those compatibility flags, I do now see the error |
There's no workaround yet other than removing that option. Now that |
Makes sense, I'll be looking forward to the change! In the meantime, I've put up a PR for the library to disable this flag so hopefully that will resolve things in the meantime. Thank you! |
Which Cloudflare product(s) does this pertain to?
Workers for Platforms
What version of
Wrangler
are you using?Latest
What operating system are you using?
All
Describe the Bug
Making a fetch request with the
cache
field throws the following exception.This was reported in our database driver in planetscale/database-js#102. We're using the
cache
attribute to advise the runtime to avoid caching any responses since the response body is an SQL result set that varies on every request.A similar issue was reported in cloudflare/workers-sdk#192, but I'm not sure what the resolution was there.
Is support for the standard Request.cache attribute planned? Ideally, we'd like to treat all JS runtimes identically and rely on the fetch interfaces to hide implementation details from the driver. Even "supporting" the attribute without throwing, but with no actual implementation, would be helpful here.
The text was updated successfully, but these errors were encountered: