Modularlization doesnt work with aws-amplify-react?
See original GitHub issue** Which Category is your question related to? **
aws-amplify-react
** What AWS Services are you utilizing? **
auth
** Provide additional details e.g. code snippets **
I am guessing I am missing something but I do not want to include the libs for every single package. I only need auth and nothing else - but importing aws-amplify-react
requires @aws-amplify/xr
which I am not using and never will.
How do I stop this? Docs seem to indicate I need to custom create aws-amplify-react
myself and make it work differently? Why is that not just done by you guys?
As it stands this package makes our bundle 10x larger with a bunch of junk.
The second I include things I get
Module not found: Error: Can't resolve '@aws-amplify/xr' in 'node_modules/aws-amplify-react/dist/XR'
@ ./node_modules/aws-amplify-react/dist/XR/SumerianScene.js 61:11-37
@ ./node_modules/aws-amplify-react/dist/XR/index.js
@ ./node_modules/aws-amplify-react/dist/index.js
Just to be clear I’ve read this 100 times and it doesn’t even make sense to me:
says to export then doesnt export or show how things are used anyway - seems to indicate we need to modify the module itself to do those things…
When the @aws-amplify/auth is not imported, Auth would be null or undefined
Check if the module is imported before using any method from the module:
// in aws-amplify-react/src/Auth/SignIn.jsx
signIn() {
You are literally providing instructions on how to fix your own package here? what gives?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top GitHub Comments
@jordanranz I tried on
"aws-amplify-react": "^3.1.5"
and2.6.3
as well and there’s no Auth in the dist folder of the project. Following #4279, Importing fromlib
folder leads to the following errorCan't resolve '@aws-amplify/ui'
. Any ideas? ThanksAs @powerful23 mentioned, if you would like to use modularization with aws-amplify-react in the current state you will need to import the React component from
dist
like so:@kalzoo @oottinger, could you try this solution?
In the meantime we are in the process of refactoring our codebase to improve modularization and the UI components as well. I will add this issue to those milestones to investigate.