My suitelet is tacking on extra debugging junk at ...
# suitescript
c
My suitelet is tacking on extra debugging junk at the end. Anyone know how to stop it from the source?
j
That's probably a NS wrapper for every page. You can see that stuff in the source of any page you are on. Suitelet or not.
c
It just started appearing. I was writing some json to output and when I added some data it started adding the wrapper as well. I guess the wrapper only gets included on responses of a certain length.
Thanks, @jarens
j
I've had this problem in the past, and I'm not sure if this is the fix, but try setting content-type header in your suitelet response
content-type: application/json
c
I set the header but it's still including the extra wrapper.
I can see the new header in the response.
t
Hey @Chris, not sure how helpful this is... I just checked one of my Suitelets that's on "na3" and it's returning a clean JSON response. The payload is only 42 KB. That same Suitelet looks at the "Accept" header and can also return HTML when it's requested. I am seeing the debug info at the end of the HTML response. Is it possible that you have some extra whitespace in the JSON response? Something that is causing NS to think it it isn't a JSON-encoded response, regardless of the response header?
c
Thanks, @tdietrich. I gave up, parsed the result and stripped off the extras. I'm okay with this remaining a mystery.