AxaFrance / oidc-client

Light, Secure, Pure Javascript OIDC (Open ID Connect) Client. We provide also a REACT wrapper (compatible NextJS, etc.).
MIT License
571 stars 152 forks source link

Need way to debug the packages when running examples #1304

Open pgangwani opened 4 months ago

pgangwani commented 4 months ago

Issue and Steps to Reproduce

I was trying to debug logout function by running examples/react-oidc-demo where I noticed that because we are using pnpm workspace, code is coming from node_modules upon install/build. Screenshot 2024-02-20 at 10 17 29 AM

How can I get actual source with same files(sourcemap) to debug it much better ?

Versions

all

Screenshots

Screenshot 2024-02-20 at 10 17 29 AM

Expected

Need to know how to debug in packages while running the example

Actual

Not finding right doc

Additional Details

pgangwani commented 4 months ago

I tried this tsconfig change. it didnt work. Screenshot 2024-02-20 at 10 41 41 AM

guillaume-chervet commented 4 months ago

Hi @pgangwani ,

I have the same problem since we have build multi packages. I would be happy to find a solution 😀

pgangwani commented 4 months ago

Hi @pgangwani ,

I have the same problem since we have build multi packages. I would be happy to find a solution 😀

Let me try few simple things.

pgangwani commented 4 months ago

I see one option to add nx tooling to it. Thoughts?

astrinxit66 commented 4 months ago

In pnpm a package in node_modules that refers to a workspace is just a symlink to that workspace.

So it's more of a vite concern than a pnpm one. Try the following:

  1. go to packages/react-oidc/package.json and in scripts replace the value of build with vite build --sourcemap inline
  2. go back to the root of the project and run pnpm run build
  3. then go to examples/react-oidc-demo and run pnpm start

You should be able to see the source code in your browser devtool. Note that you will need to run steps 2 and step 3 every time you make a change in packages/react-oidc in order to regenerate the sourcemap

pgangwani commented 4 months ago

In pnpm a package in node_modules that refers to a workspace is just a symlink to that workspace.

So it's more of a vite concern than a pnpm one. Try the following:

  1. go to packages/react-oidc/package.json and in scripts replace the value of build with vite build --sourcemap inline
  2. go back to the root of the project and run pnpm run build
  3. then go to examples/react-oidc-demo and run pnpm start

You should be able to see the source code in your browser devtool. Note that you will need to run steps 2 and step 3 every time you make a change in packages/react-oidc in order to regenerate the sourcemap

Amazing leme try