-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Unable to build or serve application that imports @aws/sdk packages #9445
Comments
Did some more digging. This StackOverflow answer partially fixed the
Keeping all polyfills from
I'm not able to say why exactly |
Assuming this is the same issue as I was running into, my solution (which I found in some other post) was to tell Vite to externalize node's builtins. Ie, |
You can try this polyfill vite-plugin-ngmi-polyfill |
WorkaroundRepo to reproduce solution to : Vite Issue 9445 Looking into this it appears to be with Demonstrated loading Found solutions at SolutionsExamples of the solution for
Required ChangesChange in export default defineConfig({
resolve: {
alias: {
// added for AWS-SDK with vite
"./runtimeConfig": "./runtimeConfig.browser"
},
},
}) Change to <script>
// Add above `main.js` script for for AWS SDK.
window.global = window;
</script> |
Still an issue in Vite 3.0.7:
|
@ffxsam would you test 3.0.8? |
@ffxsam I've confirmed that the original reproduction works with 3.0.8. Please create a new issue with reproduction if it still happens. |
@patak-dev @sapphi-red Done, submitted #9715. |
Describe the bug
I'm trying to migrate React application from CRA to Vite, but experience errors serving and building application. I've checked similar issues with AWS SDK 1, 2, but none of the suggestion seems to work. Not sure if it's related to Vite 3 (most of suggestion were posted for Vite 2) or something else.
Reproduction
malex37/marathon#15
System Info
Used Package Manager
npm
Logs
vite build --debug
vite --debug
Validations
The text was updated successfully, but these errors were encountered: