Skip to content

Does not work with NWjs + angular? #27

@ka1izer

Description

@ka1izer

Hi,

Launching NWjs correctly works, but it fails to attach, timing out saying "Cannot connect to runtime process, timeout [...] (reason: Can't find a valid target that matches: chrome-extension://*/http://localhost:4200/client/no. Available pages: [[...]_generated_background_page.html]). "

Before it times out, I can manually open "http://127.0.0.1:9223/json/list" and see two entries, one for the _generated_background_page.html, and one for our app (BUT with url = "http://localhost:4200/client/no/login")

(In package.json: main = http://localhost:4200/client/no)

The problem seems to be that the extension expects the url to be prefixed with "chrome-extension://*/", and ng server (?) has redirected or something, so it isn't prefixed...

For now, I have solved this by specifying urlFilter = "http://localhost:4200/client/no/*" in launch.json, and manually editing the source of the extension, so that it always uses args.urlFilter, never launchUrl to find process to attach to. (Line 134 in chromeDebugAdapter.js).

Am I way off here? Is there another way to fix this?

(Another point: We have our angular app project in one folder and nwjs setup (package.json etc) in another, and need to set webRoot = angular-folder and cwd = nwjs-folder to get breakpoints to work. If we do that, the default extension tries to find chrome-extension://*/index.html, (because it gets the url from the angular package.json, I assume). I don't really see how we could set this up so the unmodified extension would work... )

Latest version (1.0.18) of Debugger for NWjs, latest version of VsCode (1.39.2).
Windows 10.
Angular 8.
NWjs 0.41.2/0.42.1 (same for both).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions