Getting Error in ADD Amplify Pluggable
Before opening, please confirm:
- [X] I have searched for duplicate or closed issues and discussions.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Not applicable
Amplify APIs
REST API
Amplify Categories
No response
Environment information
Node Version: v16.13.1
"aws-amplify": "^4.3.35",
"@aws-amplify/pubsub": "^4.5.3"
Describe the bug
Hi There, Issue : amplify.addPluggable throws error when deploy on Aws Amplify Project but works fine on Localhost
Node Version: v16.13.1 "aws-amplify": "^4.3.35", "@aws-amplify/pubsub": "^4.5.3"
Locally everything is fine either its adding provider or creating mqtt connection but after deployment on amplify it throws above errorGetting Error in ADD Amplify Pluggable

Expected behavior
To be work fine.
Reproduction steps

Code Snippet
// Put your code below this line.
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
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
No response
A quick attempt to reproduce didn't work. I have a guess, but would need to see more of your project to validate.
The function getCategoryName is only part of the ConsoleLogger class, which is built similar to an Amplify Provider, but had a different interface. If I used the ConsoleLogger and called Amplify.register passing in my ConsoleLogger then when I call addPluggable it would test to see if the pluggable fit in the ConsoleLogger structure, which would exit with this error.
I don't see any other way that I might come to this error. What does the contents of src/utility/Logger look like? If you leave that dependency and log setup out, does the problem still happen?
This is my logger.js file
It works fine if I removed the code of line:15 and line:17 ..but can you please help me with using both CloudWatchProvider and AWSIoTProvider ?
Interesting. You've confirmed that PubSub/AWSIoTProvider is working as expected when not using AWSCloudWatchProvider, are you sure that AWSCloudWatchProvider is working when not using PubSub/AWSIoTProvider?
From what you've said, I would guess that there is a problem in how AWSCloudWatchProvider is configured. Are you following a specific guide to setup/configure AWSCloudWatchProvider?