Hi, all.
I’ve debugged JavaScript code before (in non-Wix contexts) by going to the Sources tab in Developer Tools, setting a breakpoint and running to that breakpoint.
In looking at the files in Sources, I conclude that Wix is written in React which is cool. Just curious, though: shouldn’t I be able to see any of my code (specifically, a backend .jsw) so that I can set a breakpoint therein?
Specifically, I’m calling a backend method from a web page and it’s apparently not going into that method; a console.log() before the method logs that fact as well as after the method but multiple console.log() calls within the method itself aren’t firing (not seeing anything in the console).
(I am correctly import-ing the method from the backend .jsw file [to confirm, I believe the “JS” part of .jsw stands for JavaScript; does the “W” stand for “web”?].)
OK, I believe that the reason that console.log() won’t work from the backend is that it’s a client-side, not a server-side, concept.
Assuming that’s the case, any recommendations for debugging backend code?
Just found out from Velo: Testing and Troubleshooting Your Code | Help Center | Wix.com that you can console.log() from the backend when a Preview-ed website but not from a Publish-ed website.
That’s correct…Wix should implement a Trace option for the backend logs…