Comments (9)
@its-dibo , try adding the Vercel Edge Runtime Polyfill (https://edge-runtime.vercel.app/packages/ponyfill) package:
pnpm add @edge-runtime/ponyfill
then to use it:
import { crypto } from '@edge-runtime/ponyfill'
from aws4fetch.
In case anyone is having this problem running Nuxt
locally, you can create a plugin as follows:
export default defineNuxtPlugin(() => {
const config = useRuntimeConfig();
if (process.server && config.public.env.toLocaleLowerCase() !== 'prod') {
const crypto = require('crypto');
global.crypto = crypto;
}
})
from aws4fetch.
Where are you running this? As the README says, this is "for environments that support fetch and SubtleCrypto"
from aws4fetch.
Where are you running this? As the README says, this is "for environments that support fetch and SubtleCrypto"
in a Nodejs app which supports fetch
from aws4fetch.
from aws4fetch.
Which Node.js version? Which OS?
Node v20
OS: ubuntu 22
from aws4fetch.
Not sure what's wrong with your env – it's defined for me:
$ node
Welcome to Node.js v20.11.0.
Type ".help" for more information.
> typeof crypto
'object'
from aws4fetch.
HI
I tried adding const crypto = require('crypto');
to the top of the code then it works.
I am day1 on nodejs using fedora with node output:
$ node
Welcome to Node.js v18.18.2.
Type ".help" for more information.
> typeof crypto
'object'
May it wouldbe of help.
from aws4fetch.
I tried adding
const crypto = require('crypto');
this wo'nt work here because aws4fetch is an external package and we cannot modify its code base
from aws4fetch.
Related Issues (20)
- sign and fetch functions don't *exactly* match TypeScripts' types.
- Lambda Function URL decoding HOT 5
- Providing custom headers when using signQuery results in incorrect SignedHeaders HOT 8
- How to use it with React Native? HOT 1
- InvalidSignatureException on redirect fetch in CF Worker HOT 2
- Race condition with ReadableStream
- Sign URLs without protocol HOT 3
- POST with empty body
- BUG: aws4fetch.authHeader excluding "content-length" and "content-type" HOT 1
- Typescript/export/module/package.json B.S. HOT 14
- Google cloud storage compatability
- Could not find a declaration file for module 'aws4fetch' HOT 3
- Feat: Make execute-api default service for API Gateway with custom URL HOT 3
- Error code not provided when goes to catch block for fetch request HOT 17
- X-Amz-Content-Sha256 not being generated HOT 3
- How to use this in a lambda? HOT 4
- headers keys change from camel case to first letter upper case and rest lowercase HOT 1
- Error handling on fetch HOT 3
- Not working in SvelteKit? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws4fetch.