Hey,
I am looking for debugging option for my PCF control inside CDS environment. Actually due to my complex logic I am wondering if possible to debug my code with CDS environment (not inside harness)?
Or can we make webapi call while in harness dev environment?
Regards,
Awais
I agree with @ScottDurow
Using the default webPack Settings, and uploading using "pac pcf push" you get a debug version (including the source-maps).
To find the code, I use in Chome "CTRL + P" and search for my component name, since this is included in the name path. That way I get the index.ts
After that you get the structure of your component in the Pages-Tab, and can make breakpoints as you wish:
Regarding requests inside Harness, I "mock" the requests. Without using tools for mocking, I decide (for now) based on window title or based on window.PCFUtilities if it's a request made inside the Harness or not, and return default/test values. (That's of course not recommended by the sdk, but in the worst case I have to delete this later on and I'm supported).
Hope it helps.
Best regards,
Diana
Using the standard web-pack config output by pac pcf init - building in development mode using tsc start watch - you should automatically get the source maps included in your bundle.js
Hi there is a good video that helped me achieve what you want:
https://www.youtube.com/watch?v=Ov-m5FBUj9g
Maybe there are better ways but this is how I do it:
1- modify : ..node_modules\pcf-scripts\webpackConfig.js
add at line 36 :
The most common approach is to use Fiddler to serve up a development build of your PCF component and then load up the Model Drive/Canvas App page as normal - but the PCF bundle.js will be served from your local machine rather than the deployed version.
See:
Thanks @ben-thompson
when we deploy code on CDS as bundle file( single javascript file) and if we have debugger line in it but still we can't understand javascript due to minified code.
Any reason why you can't just add debugger statements within your code and open Developer Tools? With the developer tools open the javascript will pause when the debugger statement is hit.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional