Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[sources] Set directory root does not work for debugger.html #7571

Closed
jasonLaster opened this issue Dec 20, 2018 · 12 comments
Closed

[sources] Set directory root does not work for debugger.html #7571

jasonLaster opened this issue Dec 20, 2018 · 12 comments
Assignees
Labels
👷‍♀️ in progress 👋 quality Currently a UI quality priority for the debugger 👋 quality-p1 Should be prioritized when working on quality issues

Comments

@jasonLaster
Copy link
Contributor

jasonLaster commented Dec 20, 2018

STR:

  1. go to http://localhost:8000/
  2. open the debugger
  3. right click on the debugger.html dir

ER: see the files below webpack
AR: see no sources

NOTE other dirs work

@jainsneha23
Copy link
Contributor

/claim

@claim
Copy link

claim bot commented Dec 22, 2018

Thanks for claiming the issue! 👋

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

🦊 Debugger team!

@jainsneha23
Copy link
Contributor

@jasonLaster Why are we setting context for webpack as launchpad? Is it a requirement?

@jasonLaster
Copy link
Contributor Author

jasonLaster commented Dec 24, 2018

@jainsneha23 i think that was a typo...

this is what fails for me

screen shot 2018-12-24 at 4 52 40 pm

screen shot 2018-12-24 at 4 52 48 pm

@jainsneha23
Copy link
Contributor

@jasonLaster The problem is with the directory being system absolute path. I am raising a WIP PR. This solves the bug. But the code needs refactoring.

@jasonLaster
Copy link
Contributor Author

Thanks. How should we refactor it?

@jainsneha23
Copy link
Contributor

@jasonLaster Basically we need a proper way to find out if the path is absolute path. This solution just works for this case, and won't last longer. Looks like a hack.

To summarise,

I can see the issue is with us not able to set the right directory path for absolute paths. The right number of slashes after webpack.

So webpack protocol is like webpack:/// and then the system absolute path starts like /Users..... Making the path webpack:////Users....

Why we are setting webpack context to launchpad folder, and not directly bundling debugger.html?
If we remove the webpack context, and bundle just the debugger.html, then all paths are relative to current working directory, and this bug is solved.

If we want to bundle scripts from launchpad, and don't want to change webpack config. Then in addtotree.js, while setting the directory, we have to take care of slashes for absolute paths.

Which solution path is better? Even if we change the webpack config for this case, I think we still need to solve this for absolute paths.

@jasonLaster
Copy link
Contributor Author

Sorry for not getting back earlier.

It would be nice to simplify how we bundle the debugger, but I am more concerned about how the debugger handles paths in the source tree in general.

@jainsneha23
Copy link
Contributor

Yeah. My initial thought was to simplify the bundling. But then I found other examples where the same issue existed. Like the angular todomvc in debugger examples. So we have to handle absolute paths anyways.

@darkwing darkwing mentioned this issue Jan 7, 2019
25 tasks
@darkwing darkwing added 👋 quality Currently a UI quality priority for the debugger 👋 quality-p1 Should be prioritized when working on quality issues labels Feb 28, 2019
@janodvarko
Copy link
Member

Is the following STRs related to this report?

  1. Load https://firefox-dev.tools/debugger-examples/examples/my-app/build/
  2. Open DevTools, select the Debugger panel
  3. Right click on Webpack dir in the Sources panel an pick Set directory root

ER:
Content of Webpack dir is displayed
AR:
Content of ~ is displayed

Honza

@jasonLaster
Copy link
Contributor Author

I hope to work on this this week. @janodvarko i'll look into that then.

@darkwing
Copy link
Contributor

Jason fixed this in MC.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
👷‍♀️ in progress 👋 quality Currently a UI quality priority for the debugger 👋 quality-p1 Should be prioritized when working on quality issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants