-
Notifications
You must be signed in to change notification settings - Fork 41
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
Node.js support? #22
Comments
@march08 I'm not sure what you mean? Server Side Rendering is orthogonal to a library like this. Can you be more specific? |
For example, |
Right, Node.js doesn't support |
fetch can be added with |
Well that must be a bug with that library, it's supported in node-fetch: |
@march08 how did you solve this? 'm using nextjs and i stuck in this problem. |
In the end i end up change to use aws4-axios to solve my problem. |
@mhart just adding to this issue. First of all, huge thanks for this. I'm trying to break away from the bloated and buggy Amplify library for my SvelteKit app. |
@badalya1 well I want to use it on browser and cf workers in production, but in node just for testing. |
Changing this to be a Node.js-support specific issue. The ability to use this locally should be supported by If anyone knows what the specific issues with current Node.js support of these APIs are, let me know! |
I achieved Node.js support with diff --git a/dist/aws4fetch.esm.js b/dist/aws4fetch.esm.js
index 9a47c421432cb8dc9f92a07a49fd46d2c00c57f3..f853ca70741083272fea7e57b405c9920402be3e 100644
--- a/dist/aws4fetch.esm.js
+++ b/dist/aws4fetch.esm.js
@@ -1,3 +1,5 @@
+import { fetch, Request, Headers, crypto, TextEncoder } from '@whatwg-node/fetch';
+
/**
* @license MIT <https://opensource.org/licenses/MIT>
* @copyright Michael Hart 2022
diff --git a/dist/aws4fetch.esm.mjs b/dist/aws4fetch.esm.mjs
index 9a47c421432cb8dc9f92a07a49fd46d2c00c57f3..f853ca70741083272fea7e57b405c9920402be3e 100644
--- a/dist/aws4fetch.esm.mjs
+++ b/dist/aws4fetch.esm.mjs
@@ -1,3 +1,5 @@
+import { fetch, Request, Headers, crypto, TextEncoder } from '@whatwg-node/fetch';
+
/**
* @license MIT <https://opensource.org/licenses/MIT>
* @copyright Michael Hart 2022
* |
It works on both Node v20.5.1 and Cloudflare Worker. |
works well in the browser however there are some differences in the WebAPI vs node. Are you planning to add SSR support as well? Thanks
The text was updated successfully, but these errors were encountered: