amplify-js: Dependency on paho-mqtt should be removed - package is no longer maintained and contains bugs
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- 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
PubSub
Amplify Categories
Not applicable
Environment information
# Put output below this line
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Memory: 20.23 GB / 64.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.1 - ~/.volta/tools/image/node/14.18.1/bin/node
Yarn: 2.4.1 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
npm: 6.14.15 - ~/.volta/tools/image/node/14.18.1/bin/npm
Watchman: 2021.11.01.00 - /usr/local/bin/watchman
Browsers:
Brave Browser: 91.1.26.74
Chrome: 95.0.4638.69
Firefox: 94.0.1
Safari: 15.0
npmPackages:
@babel/core: ^7.15.5 => 7.15.5 (7.15.0, 7.14.3)
@maxmind/geoip2-node: ^3.2.0 => 3.2.0
@nuxt/types: ~2.15.8 => 2.15.8
@nuxtjs/axios: ^5.13.6 => 5.13.6
@nuxtjs/eslint-config: ^5.0.0 => 5.0.0
@nuxtjs/eslint-module: ^3.0.2 => 3.0.2
@nuxtjs/sentry: ^5.1.4 => 5.1.4
@nuxtjs/vuetify: ^1.12.1 => 1.12.1
@vue/cli-plugin-babel: ^4.5.13 => 4.5.13
@vue/eslint-config-standard: ^6.1.0 => 6.1.0
aliyun-nodejs: 1.0.0
aws-alexa-typescript: 1.0.0
aws-amplify: ^4.3.1 => 4.3.1
aws-nodejs-ecma-script: 1.0.0
aws-nodejs-typescript: 1.0.0
azure-nodejs: 1.0.0
azure-nodejs-typescript: 1.0.0
azure-python: 1.0.0
babel-eslint: ^10.1.0 => 10.1.0
babel-jest: ^27.2.4 => 27.2.4
camelcase-keys: ^6.2.2 => 6.2.2 (7.0.0)
change-case: ^4.1.2 => 4.1.2
cloudflare-workers: 1.0.0
cloudflare-workers-enterprise: 1.0.0
cloudflare-workers-rust: 1.0.0
cookie-universal-nuxt: ^2.1.5 => 2.1.5
core-js: ^3.18.1 => 3.18.1 (2.6.12, 3.16.1, 3.16.0)
debug: ^4.3.2 => 4.3.2 (2.6.9, 3.1.0, 3.2.7)
dev: 1.0.0
env-cmd: ^10.1.0 => 10.1.0
eslint: ^7.32.0 => 7.32.0
eslint-config-prettier: ^7.2.0 => 7.2.0
eslint-plugin-nuxt: ^2.0.0 => 2.0.0
eslint-plugin-prettier: ^3.4.1 => 3.4.1
eslint-plugin-vue: ^7.18.0 => 7.18.0 (7.10.0)
fn-go: 1.0.0
fn-node: 1.0.0
google-nodejs: 0.1.0
google-nodejs-typescript: 1.0.0
google-python: 0.1.0
hellofn: 1.0.0
husky: ^4.3.8 => 4.3.8
jest: ^27.2.4 => 27.2.4
knative-docker: 1.0.0
konva: ^8.2.1 => 8.2.1
kubeless-nodejs: 1.0.0
kubeless-python: 1.0.0
lint-staged: ^10.5.4 => 10.5.4
lodash.debounce: ^4.0.8 => 4.0.8
nuxt: ^2.15.8 => 2.15.8
nuxt-start: ^2.15.8 => 2.15.8
openwhisk-java: 1.0.0
openwhisk-nodejs: 1.0.0
openwhisk-php: 1.0.0
openwhisk-python: 1.0.0
openwhisk-ruby: 1.0.0
openwhisk-swift: 1.0.0
plyr: ^3.6.8 => 3.6.8
prettier: ^2.4.1 => 2.4.1 (1.19.1)
serverless: ^2.59.0 => 2.59.0
serverless-apigw-binary: ^0.4.4 => 0.4.4
serverless-domain-manager: ^5.1.5 => 5.1.5
serverless-google-hello-world: 0.1.0
serverless-nuxt: ^1.1.2 => 1.1.2
serverless-nuxt-plugin: ^1.5.0 => 1.5.0
serverless-openwhisk-hello-world: 0.1.0
serverless-plugin: 1.0.0
sls-csharp: 1.0.0
spotionst-java8: 1.0.0
spotionst-nodejs: 1.0.0
spotionst-python: 1.0.0
spotionst-ruby: 1.0.0
tencent-golang: 1.0.0
tencent-nodejs: 1.0.0
tencent-php: 1.0.0
tencent-python: 1.0.0
tinycolor2: ^1.4.2 => 1.4.2
twilio-nodejs-runtime-example: 1.0.0
validator: ^13.6.0 => 13.6.0
vue-linkify: ^1.0.1 => 1.0.1
vuetify: ^2.5.9 => 2.5.9 (2.5.3)
vuetify-loader: ^1.7.3 => 1.7.3 (1.7.2)
vuex: ^3.6.2 => 3.6.2
waveform-data: ^4.1.1 => 4.1.1
npmGlobalPackages:
npm: 6.14.15
Describe the bug
AWS Amplify should definitely consider replacing paho-mqtt with something else. It’s a package that’s no longer maintained, and has issues which are causing Amplify to break.
While there are workarounds like using patch-package to monkey patch it, this isn’t ideal as many people don’t know this is even possible (I didn’t know until today!).
Expected behavior
N/A
Reproduction steps
N/A
Code Snippet
No response
Log output
No response
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (12 by maintainers)
Hello @ffxsam,
The change that includes the
paho-mqttpatch in Amplify was released today. If you upgrade toaws-amplify@5.0.10or later, your application should support PubSub for users who have cookies disabled.Hi @ffxsam - We’ve had a couple of investigations on this that have not been fully completed, our issue has been identifying a dependency that we can use that can provide us with coverage to both Web and React Native. There is still some ground work for us to do - and we’ll respond back with updates when we have them.
Hey @abdallahshaban557! I could be way off base, but this seems like a somewhat critical issue? (is “somewhat” critical a thing? 😆)
@yaquawa I sure did. The solution was to use Yarn’s
patchfeature (make sure you’re using Yarn 3.x). But I can save you most of the work.In case you’re using the old Yarn 1.x, the quickest way to switch to the latest version:
and add this to your .gitignore:
Once that’s all set up, copy this file into
.yarn/patches:Make sure
paho-mqttis installed. Then add this to your project’spackage.json:Finally, run
yarnto apply the patch and it’s done! Anytime anyone clones your project and runsyarn, it’ll take care of patching this for you.