Skip to content
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

Tried to publish a string but received an error #3

Open
hidari358 opened this issue May 15, 2020 · 1 comment
Open

Tried to publish a string but received an error #3

hidari358 opened this issue May 15, 2020 · 1 comment

Comments

@hidari358
Copy link

Hi there, would like to ask why would I get this error when I try to publish a string? Here attached are the errors stated in command prompt:

SyntaxError: Unexpected token è in JSON at position 0
at JSON.parse ()
at exports.JsonTransform (C:\Users\user\test-nestjs\node_modules\nest-mqtt\dist\mqtt.transform.js:4:17)
at C:\Users\user\test-nestjs\node_modules\nest-mqtt\dist\mqtt.explorer.js:108:36
at Array.map ()
at MqttClient. (C:\Users\user\test-nestjs\node_modules\nest-mqtt\dist\mqtt.explorer.js:105:82)
at MqttClient.emit (events.js:311:20)
at MqttClient._handlePublish (C:\Users\user\test-nestjs\node_modules\nest-mqtt\node_modules\mqtt\lib\client.js:1162:12)
at MqttClient._handlePacket (C:\Users\user\test-nestjs\node_modules\nest-mqtt\node_modules\mqtt\lib\client.js:351:12)
at work (C:\Users\user\test-nestjs\node_modules\nest-mqtt\node_modules\mqtt\lib\client.js:283:12)
at Writable.writable._write (C:\Users\user\test-nestjs\node_modules\nest-mqtt\node_modules\mqtt\lib\client.js:294:5)

@hidari358 hidari358 changed the title Tried to send a string but received an error Tried to publish a string but received an error May 15, 2020
@longdratech
Copy link

pls add JSON.stringify into JSON.parse in mqtt.transform file

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants