node-red-contrib-model-asset-exchange icon indicating copy to clipboard operation
node-red-contrib-model-asset-exchange copied to clipboard

Nodes cannot handle JSON input

Open ptitzler opened this issue 5 years ago • 2 comments

During some random testing I've noticed that if JSON is passed in as input the following error message is displayed in the debug window:

TypeError: source.on is not a function

To recreate:

  • import any sample flow
  • choose a JSON document as input

ptitzler avatar Mar 07 '19 23:03 ptitzler

Would the desired behavior be a more descriptive error message, or to be able to submit JSON as input in the case of text-based models?

My assumption is that the latter case would work if the JSON was contained in msg.payload but would need some extra processing if we wanted to be able to parse the JSON and detect input values.

kastentx avatar Mar 18 '19 20:03 kastentx

Well, I expected that the node [backend] would reject the invalid payload with HTTP code 400, but somehow something blows up during node-red processing, raising this error.

ptitzler avatar Mar 18 '19 21:03 ptitzler