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

Error: The 'cache' field on 'RequestInitializerDict' is not implemented. #1407

Closed
r3dpoint opened this issue Sep 19, 2024 · 7 comments · Fixed by #1411
Closed

Error: The 'cache' field on 'RequestInitializerDict' is not implemented. #1407

r3dpoint opened this issue Sep 19, 2024 · 7 comments · Fixed by #1411
Assignees

Comments

@r3dpoint
Copy link

r3dpoint commented Sep 19, 2024

Started seeing this error when using AWS S3 SDK to GetObject in a Cloudflare Pages App, which runs on workerd:

✘ [ERROR] Error: The 'cache' field on 'RequestInitializerDict' is not implemented.

 at FetchHttpHandler.handle
  (file:///.../node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js:77:30)
      at null.<anonymous> (async

I will attempt a downgrade. I may try a standalone app to share.

Update pinning to 3.2.5 resolves the error.

@nicksrandall
Copy link
Contributor

Also running into this... cache setting is not implemented in Cloudflare workers.

@flexchar
Copy link

Same, cloudflare workerd runtime.

Had to downgrade to 3.645.0

"@aws-sdk/client-s3": "3.645.0",
"@aws-sdk/s3-request-presigner": "3.645.0",

@nicksrandall
Copy link
Contributor

I believe the error is here: https://github.com/smithy-lang/smithy-typescript/blob/main/packages/fetch-http-handler/src/fetch-http-handler.ts#L115

This is the breaking commit: cf9257e

@kuhe
Copy link
Contributor

kuhe commented Sep 20, 2024

cloudflare/workerd#698

@kuhe
Copy link
Contributor

kuhe commented Sep 20, 2024

We will accept the patch once approved, but until then there is a workaround posted in the linked issue

const client = new SDKClient({
  requestHandler: {
    // Cloudflare doesn't support the cache option, so we remove it.
    requestInit: () => ({
      cache: undefined,
    }),
  },
});

@kuhe kuhe self-assigned this Sep 20, 2024
nicksrandall added a commit to nicksrandall/smithy-typescript that referenced this issue Sep 20, 2024
kuhe pushed a commit that referenced this issue Sep 20, 2024
@kuhe
Copy link
Contributor

kuhe commented Sep 20, 2024

released in https://www.npmjs.com/package/@smithy/fetch-http-handler/v/3.2.8

@r3dpoint
Copy link
Author

confirmed fixed for me with latest aws client s3 + v3.2.8 of fetch-http-handler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants