question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failure following recent MQTT release

See original GitHub issue

Confirm by changing [ ] to [x] below to ensure that it’s a bug:

Describe the bug Our builds have been failing with the following tracebacks this week:

$ npm run build
> ionicskala5@2.0.1 build /builds/Software/IonicSkala
> ionic-app-scripts build
[15:33:43]  ionic-app-scripts 3.2.4 
[15:33:43]  build dev started ... 
[15:33:43]  clean started ... 
[15:33:43]  clean finished in 2 ms 
[15:33:43]  copy started ... 
[15:33:43]  deeplinks started ... 
[15:33:45]  deeplinks finished in 1.70 s 
[15:33:45]  transpile started ... 
[15:34:17]  transpile finished in 32.86 s 
[15:34:17]  preprocess started ... 
[15:34:17]  preprocess finished in 2 ms 
[15:34:17]  webpack started ... 
[15:34:18]  copy finished in 34.98 s 
[15:34:44]  ionic-app-script task: "build" 
[15:34:44]  Error: ./node_modules/mqtt/lib/client.js Module parse failed: Unexpected token (118:38) You may need an 
            appropriate loader to handle this file type. | if (alias) { | packet.topic = '' | packet.properties = { 
            ...(packet.properties), topicAlias: alias } | debug('applyTopicAlias :: auto assign(use) topic: %s - alias: 
            %d', topic, alias) | } else { @ ./node_modules/mqtt/lib/connect/index.js 3:19-39 @ 
            ./node_modules/aws-crt/dist.browser/browser/mqtt.js @ ./node_modules/aws-crt/dist.browser/browser.js @ 
            ./node_modules/aws-iot-device-sdk-v2/dist/index.js @ ./src/pages/util/SkalaControlWebsocket.ts @ 
            ./src/app/app.module.ts @ ./src/app/main.ts 
Error: ./node_modules/mqtt/lib/client.js
Module parse failed: Unexpected token (118:38)
You may need an appropriate loader to handle this file type.
|               if (alias) {
|                 packet.topic = ''
|                 packet.properties = { ...(packet.properties), topicAlias: alias }
|                 debug('applyTopicAlias :: auto assign(use) topic: %s - alias: %d', topic, alias)
|               } else {
 @ ./node_modules/mqtt/lib/connect/index.js 3:19-39
 @ ./node_modules/aws-crt/dist.browser/browser/mqtt.js
 @ ./node_modules/aws-crt/dist.browser/browser.js
 @ ./node_modules/aws-iot-device-sdk-v2/dist/index.js
 @ ./src/pages/util/SkalaControlWebsocket.ts
 @ ./src/app/app.module.ts
 @ ./src/app/main.ts
    at new BuildError (/builds/Software/IonicSkala/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/builds/Software/IonicSkala/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at /builds/Software/IonicSkala/node_modules/webpack/lib/Compiler.js:265:13
    at Compiler.emitRecords (/builds/Software/IonicSkala/node_modules/webpack/lib/Compiler.js:371:38)
    at /builds/Software/IonicSkala/node_modules/webpack/lib/Compiler.js:258:10
    at /builds/Software/IonicSkala/node_modules/webpack/lib/Compiler.js:364:12
    at next (/builds/Software/IonicSkala/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.<anonymous> (/builds/Software/IonicSkala/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/builds/Software/IonicSkala/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/builds/Software/IonicSkala/node_modules/webpack/lib/Compiler.js:361:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionicskala5@2.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionicskala5@2.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-01-06T15_34_44_300Z-debug.log

I know that AWS IOT uses the MQTT.js project as their MQTT client, and MQTT released a new version 22 hours ago. I was only able to make the errors above go away by reverting MQTT to version 2.18.9, the last stable version before AWS IOT’s last release. With any newer version, the issue seems to reappear.

SDK version number 1.6.4

Platform/OS/Hardware/Device Happens on all our machines, both Windows and Linux docker containers.

To Reproduce (observed behavior) We have an Ionic application, and Ionic has its own CLI for building the project. This issue seems to occur at the build stage. Not sure how to help you all reproduce this issue, but I am having trouble understanding the traceback and maybe you all may have some more ideas? Other people have to be experiencing this issue, and it could be that it only occurred last night with the latest release of MQTT.

const level : io.LogLevel = parseInt(io.LogLevel[argv.verbosity.toUpperCase()]);
io.enable_logging(level);

Additional context Temporary fix seems to be specifically rolling back MQTT to 2.18.9.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
xiazhveracommented, Feb 2, 2022

Hi @omar-enrique, we have tested couple samples with MQTT 4.3.0, but we are not able to reproduce the issue. It would be hard for us to track the issue without the same dev environment setup. Therefore, we will move on to other issues for now.

0reactions
github-actions[bot]commented, Jul 28, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial: Republishing an MQTT message - AWS IoT Core
This tutorial demonstrates how to create an AWS IoT rule that publishes an MQTT message when a specified MQTT message is received.
Read more >
'MQTT Connection Offline' error - Cloud One - Workload ...
Learn how to troubleshoot the 'MQTT Connection Offline' error that occurs after Activity Monitoring is enabled in Cloud One - Workload Security.
Read more >
Maven build Compilation error : Failed to execute goal org. ...
No matter how many times I build the project, i get the same error. Even after cleaning the project and refreshing it from...
Read more >
mqtt-v5.0.html - MQTT Version 5.0 - OASIS Open
An error that is detected after the packet has been parsed and found to contain data that is not allowed by the protocol...
Read more >
IoT Platform:Use the Paho MQTT Android client
You must add the following dependencies. In the build.gradle file, add the address of the Paho repository. In this example, the release ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found