How do I debug a node_module inside my angular application?

521 views Asked by At

I have a angular9 ClientApp. I have a asp.net core webapi & IdentityServer4 for the backend. I imported oidc-client in my ClientApp. When I call userManager.signinSilent my app is being redirected to

http://localhost/webapi/home/error?errorId...

Which results in a

404

How do I step through the oidc-client javascript to find out why it is doing this? I've tried searching my sources for this function but I only find oidc-client.js and it looks like everything is obfuscated.

1

There are 1 answers

0
hashbytes On

How does a web-pack packages a node module file into bundle?

If you are using package X (OIDC), you need to check packge.json file of the package.

Look at the main property, it should refer to a .min.js file or .min file https://github.com/IdentityModel/oidc-client-js/blob/dev/package.json#L5

Look if you are looking for a way to debug, change the .min.js to .js as oidc has exposing minified and un-minified version https://github.com/IdentityModel/oidc-client-js/tree/dev/lib

Once you change the package.json main property of oidc package in node_modules, and rerun the app, this time, you will see oidc-client.js in chrome console source for debugging.