Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need way to debug the packages when running examples #1304

Open
pgangwani opened this issue Feb 20, 2024 · 6 comments
Open

Need way to debug the packages when running examples #1304

pgangwani opened this issue Feb 20, 2024 · 6 comments

Comments

@pgangwani
Copy link

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

  • Installed packages:
@pgangwani
Copy link
Author

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

@guillaume-chervet
Copy link
Contributor

Hi @pgangwani ,

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

@pgangwani
Copy link
Author

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
Copy link
Author

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

@astrinxit66
Copy link
Contributor

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants