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

fix(webpack): web app in default nx config not working with @aws-sdk #15962

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

owen26
Copy link
Contributor

@owen26 owen26 commented Mar 29, 2023

Current Behavior

web apps created via default NX configurations won't work with @aws-sdk

the reason is that all AWS SKD v3 packages define only partial entry via browser, and the rest via either module for browser, or main for node.js

with default NX withWeb settings, which inherit from withNX settings, the order will be browser, main, and module, in the case of AWS SDK, webpack will wrongly import most of the node.js packages instead of browser oriented packages.

I do not see a reason why this shouldn't be overwritten in withWeb config to let module takes priority. Thus the changes in this PR did it.

Expected Behavior

should work with AWS SDK (and potentially other open source libraries uses similar strategy as AWS SDK

Related Issue(s)

#14920

Fixes #14920

@vercel
Copy link

vercel bot commented Mar 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2023 6:18pm

@jaysoo jaysoo self-assigned this Apr 25, 2023
@jaysoo jaysoo added scope: bundlers Issues related to webpack, rollup type: bug labels Apr 25, 2023
@github-actions
Copy link

github-actions bot commented May 1, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React app not working due to missing polyfills (can't resolve module in package)
2 participants