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

AWS-SDK intergration in angular #3895

Closed
2 tasks done
ghost opened this issue Sep 23, 2021 · 2 comments
Closed
2 tasks done

AWS-SDK intergration in angular #3895

ghost opened this issue Sep 23, 2021 · 2 comments
Labels
guidance Question that needs advice or information.

Comments

@ghost
Copy link

ghost commented Sep 23, 2021

Confirm by changing [ ] to [x] below:

I'm using Angular 12.1.4 and I get this error when I import the library in one of my ts files

./node_modules/aws-sdk/lib/event_listeners.js:595:21-44 - Error: Module not found: Error: Can't resolve 'util' in '/Users/apple.inc/Documents/Angular/Personal/ofm-web/node_modules/aws-sdk/lib'
Did you mean './util'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (/Users/apple.inc/Documents/Angular/Personal/ofm-web, node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

@ghost ghost added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Sep 23, 2021
@ajredniwja
Copy link
Contributor

HI @Emmanuel-Nika, thanks for opening this issue, as mentioned in the issue, webpack does not pollyfill for core node modules anymore. So the workaround would be to pollyfill manually. Have seen this issue here with workarounds, I have personally used this module in the past to get things working. Please reach out if you have any questions.

@ajredniwja ajredniwja added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 29, 2021
@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants
@ajredniwja and others