Closed pfried closed 9 months ago
The same thing happens if you install the monolithic package + PubSub:
"aws-amplify": "^5.0.8",
"@aws-amplify/pubsub": "^5.0.8",
Then the Hub (+Observers) do not work as the pacakges are not hoistsed. This is a serious issue as it is not so easy to diagnose
Possibly related to https://github.com/aws-amplify/amplify-js/issues/7772
@pfried, can you see if you continue to experience this issue if you upgrade to the most recent version of Amplify? With the release of the latest major version of Amplify (aws-amplify@>6), we believe this issue should now be resolved! Please refer to our release announcement, migration guide, and documentation for more information.
@pfried, just wanted to circle back and see if you've had a chance to upgrade and test this in v6 of Amplify. Let us know if you do!
@cwomack No unfortunately this could take some weeks until I get to that
@pfried, we'll close this issue then for now but will be happy to reopen it if you experience this in v6 after upgrading. This should be resolved in the latest version.
Thank you!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication, GraphQL API, PubSub
Amplify Categories
auth, api
Environment information
Describe the bug
Using the modular amplify packages as in https://github.com/aws-amplify/amplify-js/wiki/Amplify-Modularization i run into an error where the auth (called by the pubsub) instance errors with:
My setup is a yarn monorepo with a
nmHoistingLimits: dependencies
configurationMy guess is that it is due to the fact that the
@aws-ampify/api
package has a node_modules folder with another@aws-ampify/auth
package which is not hoisted to the top. Should those dependencies not be peer dependencies?Expected behavior
To work exactly like the monolothic package
Reproduction steps
Clone my repo and create a subscription on an API,. Login via a Cognito pool and see the error when the subscription is called
Repro: https://github.com/pfried/appsync-module-lib-issue-repro-webapp
Code Snippet
Log output
aws-exports.js
Manual configuration
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
app
node_modules
@aws-amplify/api
node_modules