You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Because each @aws-amplify/* module has a runtime dependency on @aws-amplify/core, it is possible to bundle multiple versions of core. When it comes time for modules to register, they will not be registering on the same class and will therefore never know about eachother.
git clone https://github.com/nihakue/amplify-module-registration-bug.git
cd amplify-module-registration-bug
yarn && yarn start
You should be able to see on localhost:3000 that we have three different versions of core, each with different modules registered. Check in src/App.jsx and src/amplify.js to see how this was done by following the docs for consuming amplify modules. The problem arises from the consumer depending on @aws-amplify/core directly at a version prior to the one in your modules.
Expected behavior
I don't have a great answer, since even if @aws-amplify/core was a peer dependency you could get incompatible versions of core being depended on by your modules, but you could definitely be more resilient to this problem by setting the core semver really liberally (as is standard practice for peer dependencies).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
Because each @aws-amplify/* module has a runtime dependency on @aws-amplify/core, it is possible to bundle multiple versions of core. When it comes time for modules to register, they will not be registering on the same class and will therefore never know about eachother.
To Reproduce
Steps to reproduce the behavior:
https://github.com/nihakue/amplify-module-registration-bug
You should be able to see on
localhost:3000
that we have three different versions of core, each with different modules registered. Check in src/App.jsx and src/amplify.js to see how this was done by following the docs for consuming amplify modules. The problem arises from the consumer depending on @aws-amplify/core directly at a version prior to the one in your modules.Expected behavior
I don't have a great answer, since even if @aws-amplify/core was a peer dependency you could get incompatible versions of core being depended on by your modules, but you could definitely be more resilient to this problem by setting the core semver really liberally (as is standard practice for peer dependencies).
Screenshots
https://github.com/nihakue/amplify-module-registration-bug/blob/master/screenshot.png
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
N/A
Sample code
https://github.com/nihakue/amplify-module-registration-bug
You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.
The text was updated successfully, but these errors were encountered: