Skip to content

Fix adding a breakpoint in a JS file while debugging a blazor app#1488

Merged
connor4312 merged 5 commits into
microsoft:mainfrom
thaystg:thays_fix_js_debug_on_blazor
Dec 27, 2022
Merged

Fix adding a breakpoint in a JS file while debugging a blazor app#1488
connor4312 merged 5 commits into
microsoft:mainfrom
thaystg:thays_fix_js_debug_on_blazor

Conversation

@thaystg

@thaystg thaystg commented Dec 16, 2022

Copy link
Copy Markdown
Member

When adding a breakpoint the urlRegex passed to a blazor app for a js app before this PR was:
"[fF][iI][lL][eE]:\/\/\/[tT]:\/[tT][hH][aA][yY][sS]\/[oO][fF][fF][iI][cC][eE]-[aA][dD][dD]-[iI][nN]-[sS][aA][mM][pP][lL][eE][sS]\/[sS][aA][mM][pP][lL][eE][sS]\/[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\/[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\/[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\/[pP][aA][gG][eE][sS]\/[iI][nN][dD][eE][xX]\.[rR][aA][zZ][oO][rR]\.[jJ]sS|[tT]:\\[tT][hH][aA][yY][sS]\\[oO][fF][fF][iI][cC][eE]-[aA][dD][dD]-[iI][nN]-[sS][aA][mM][pP][lL][eE][sS]\\[sS][aA][mM][pP][lL][eE][sS]\\[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\\[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\\[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\\[pP][aA][gG][eE][sS]\\[iI][nN][dD][eE][xX]\.[rR][aA][zZ][oO][rR]\.[jJ]sS"

And using this PR will be:
[fF][iI][lL][eE]:\/\/\/[tT]:\/[tT][hH][aA][yY][sS]\/[oO][fF][fF][iI][cC][eE]-[aA][dD][dD]-[iI][nN]-[sS][aA][mM][pP][lL][eE][sS]\/[sS][aA][mM][pP][lL][eE][sS]\/[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\/[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\/[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\/[pP][aA][gG][eE][sS]\/[iI][nN][dD][eE][xX]\.[rR][aA][zZ][oO][rR]\.[jJ]sS|[tT]:\\[tT][hH][aA][yY][sS]\\[oO][fF][fF][iI][cC][eE]-[aA][dD][dD]-[iI][nN]-[sS][aA][mM][pP][lL][eE][sS]\\[sS][aA][mM][pP][lL][eE][sS]\\[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\\[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\\[eE][xX][cC][eE][lL]-[bB][lL][aA][zZ][oO][rR]-[aA][dD][dD]-[iI][nN]\\[pP][aA][gG][eE][sS]\\[iI][nN][dD][eE][xX]\.[rR][aA][zZ][oO][rR]\.[jJ]sS|[hH][tT][tT][pP][sS]:\/\/[lL][oO][cC][aA][lL][hH][oO][sS][tT]:7287\/[pP][aA][gG][eE][sS]\/[iI][nN][dD][eE][xX]\.[rR][aA][zZ][oO][rR]\.[jJ]sS"

Adding the https://localhost:7287/pages/index.razor.js as it's done when debugging without using blazorSourcePath.

Without the PR it was necessary to disable and enable the breakpoint after the APP is already started to bind the breakpoint.

Related to OfficeDev/Office-Add-in-samples#444

@thaystg

thaystg commented Dec 16, 2022

Copy link
Copy Markdown
Member Author

@lewing

@thaystg thaystg changed the title Fix adding a breakpoint in a JS file in a blazor app. Fix adding a breakpoint in a JS file while debugging a blazor app Dec 16, 2022
connor4312
connor4312 previously approved these changes Dec 16, 2022
@connor4312

Copy link
Copy Markdown
Member

It looks like there's a unit test that needs to be updated 🙂

@connor4312

Copy link
Copy Markdown
Member

Fyi it looks like the unit test is still failing. You can single out and run that test locally using npm run test:golden -- -g "generates the correct regexp in local scenarios"

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

Successfully merging this pull request may close these issues.

2 participants