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

Debugger stops when redirecting through auth flow #140

Open
robjackstewart opened this issue Jan 7, 2024 · 2 comments
Open

Debugger stops when redirecting through auth flow #140

robjackstewart opened this issue Jan 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@robjackstewart
Copy link

Im writing my first ionic app and Im using the auth0 framework as demonstrated here. However, due to the use of Browser.open({ url, windowName: '_self' }); when I go through the auth flow, the debugger dies due to being disconnected from the running instance of the app.

Is there a way to keep the debugger running such that it reattaches upon redirect back to the app?

@robjackstewart
Copy link
Author

robjackstewart commented Jan 14, 2024

So I have managed to get this working via a workaround not using the ionic VSCode extension by using the following VSCode debug setup:

// tasks.json
{
    "tasks": [
        {
            "label": "Start development server",
            "type": "shell",
            "isBackground": true,
            "command": "npx",
            "args": [
                "ionic",
                "serve",
                "--no-open",
                "--external",
                "--configuration=development",
                "--no-open",
                "--inspect"
            ],
            "problemMatcher": [
                {
                  "pattern": [
                    {
                      "regexp": ".",
                      "file": 1,
                      "line": 1,
                      "column": 1,
                      "message": 1
                    }
                  ],
                  "background": {
                    "activeOnStart": true,
                    "beginsPattern": { "regexp": "." },
                    "endsPattern": { "regexp": "^\\[INFO\\] Development server running!$" }
                  }
                }
            ]
        }
    ]
}

... and then running the following VSCode debug profile:

// launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Edge",
            "type": "msedge",
            "request": "launch",
            "url": "http://localhost:8100",
            "webRoot": "${workspaceFolder}",
            "preLaunchTask": "Start development server"
        },
    ]
}

Naturally, Id rather use the extension which I think could be achieved by adding a new setting for the extension which sets the arguments passed to the ionic serve command. That said, I'm not sure about why the ionic extension debugger stops when the VSCode debugger does not. I actually tried changing the method of authentication to use a popover windows rather then redirect the existing window and even closing the popover window caused the ionic debugger to stop.

Any ideas what sort of changes we need to make to keep the debugger alive?

@dtarnawsky dtarnawsky added the enhancement New feature or request label Feb 7, 2024
@dtarnawsky
Copy link
Contributor

This item is being treated as a feature request. The extension generates a dynamic launch.json and tasks.json for debugging and doesn't currently have a way to customize this.

@kensodemann kensodemann transferred this issue from ionic-team/vscode-extension May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants