-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ali Mini Program not work in v4.2.0 #1140
Comments
release 4.2.1 (#1149) should fix this. |
apologies unrelated |
version v4.2.1 not work well too,the same error occur. TypeError: net.createConnection is not a function
at Object.streamBuilder (mqtt.js:1737)
at MqttClient.wrapper [as streamBuilder] (mqtt.js:2388)
at MqttClient._setupStream (mqtt.js:300)
at new MqttClient (mqtt.js:279)
at connect (mqtt.js:2391)
at Object.doConnect (tasks.js:76)
at Object.onTap (tasks.js:50) Now i have to download the source code then remove the codition typeof __webpack_require__ === 'function' and according to PR #1057 to fix other error,it will work well on real phone.So there any other best way to solve this problem? |
In fact, at PR #1135 // eslint-disable-next-line camelcase
if ((typeof process !== 'undefined' && process.title !== 'browser') || typeof __webpack_require__ === 'function') {
protocols.mqtt = require('./tcp')
protocols.tcp = require('./tcp')
protocols.ssl = require('./tls')
protocols.tls = require('./tls')
protocols.mqtts = require('./tls')
} the codition here is to judge if However
Here's the correction: // eslint-disable-next-line camelcase
if ((typeof process === 'undefined' || process.title !== 'browser') && typeof __webpack_require__ !== 'function') {
protocols.mqtt = require('./tcp')
protocols.tcp = require('./tcp')
protocols.ssl = require('./tls')
protocols.tls = require('./tls')
protocols.mqtts = require('./tls')
} Just like the code at the same PR: // eslint-disable-next-line camelcase
var IS_BROWSER = (typeof process !== 'undefined' && process.title === 'browser') || typeof __webpack_require__ === 'function' |
yes , you are right |
In PR #1135 change index.js and add
I found that
in Ali Mini Program is true,so will not go else conditional branch to require correct protocol file(ali.js) than an error occur
AB#8667518
The text was updated successfully, but these errors were encountered: