Vite work greate on local development.
But I got this error when build.
'request' is not exported by __vite-browser-external, imported by node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-imds/dist/es/remoteProvider/httpRequest.js
The solution is put some script on index.html
<script>
var global = global || window
var Buffer = Buffer || []
var process = process || { env: { DEBUG: undefined }, version: [] }
</script>
And that's it, all sorted! 😛
Thanks community.
Top comments (2)
Thanks, but unfortunately this didn't work for me but this fix did:
So my
vite.config.js
looks like this:Uncaught TypeError: t is not a constructor
Iam also facing this kind of issues when using aws-sdk with vite.js . Iam facing this above type of error.