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

Error while opening CSS file in editor #787

Closed
riks1233 opened this issue Jan 1, 2022 · 4 comments · Fixed by #885 or microsoft/vscode-js-debug#1206
Closed

Error while opening CSS file in editor #787

riks1233 opened this issue Jan 1, 2022 · 4 comments · Fixed by #885 or microsoft/vscode-js-debug#1206
Labels
bug Something isn't working tracked

Comments

@riks1233
Copy link

riks1233 commented Jan 1, 2022

    **Version:**
    1.4.2

    **OS:**
    Windows 10

    **Stack :**
    Could not open document. No workspace mapping was found for 'http://ecalendar-admin-panel/css/styles.css'.

    **Additional context:**
    <!-- Add any other context or about the problem or screenshots here. -->

Problem description

I have a project ecalendar-admin-panel running on http://ecalendar-admin-panel:80. The web root (or "docroot" or whatever) is pointing to ecalendar-admin-panel/public folder. Just for clarity, when I go to http://ecalendar-admin-panel:80 in my browser, I actually request files from ecalendar-admin-panel/public folder.

I use "Launch Edge" configuration to use Edge DevTools. My launch.json looks like this:

{
    "configurations": [
        {
            "name": "Launch Edge",
            "request": "launch",
            "type": "pwa-msedge",
            "url": "http://ecalendar-admin-panel:80",
            "webRoot": "${workspaceFolder}/public/",
        }
    ]
}

I start a debugging session by pressing this button:

image

And when clicking on styles.css in "Edge DevTools" panel I get two errors:

image
image

  • An error occurred: Error while opening file in editor. Could not open document. No workspace mapping was found for 'http://ecalendar-admin-panel/css/styles.css'..
  • Unable to open file in editor. http://localhost/css/styles.css does not map to a local file.

Additional info

I've also tried some other launch.js configurations, none of which worked, like:

  • "webRoot": "C:/<fullpath>/ecalendar-admin-panel/public/"
  • "webRoot": "${workspaceFolder}/public" - No forward slash at the end.
  • "pathMapping": { "/": "${workspaceFolder}/public/", "http://ecalendar-admin-panel/": "${workspaceFolder}/public/", }

I've also created a folder and a file css/styles.css in project root folder (ecalendar-admin-panel/css/styles.css) just to test that and then Edge DevTools forwarded me to that file, when I clicked styles.css (i.e. it did work!). But I need Edge DevTools to open the actual ecalendar-admin-panel/public/css/styles.css file.

Suggestion

If I configured everything properly, then "webRoot" and "pathMapping" parameters are ignored by the extension.

@riks1233 riks1233 changed the title [0] Error while opening file in editor. Error while opening CSS file in editor Jan 1, 2022
@riks1233
Copy link
Author

riks1233 commented Jan 1, 2022

Forgot to mention (if that matters), that I use Wampserver (64-bit) to run the project locally.

@collinanderson
Copy link

I'm having a simliar issue on my Mac, though I'm using Remote - SSH. I'm using the vscode-edge-devtools.debug type, but it still just says:

Unable to open file in editor. https://dev.example.com/static/common.css does not map to a local file.
An error occurred: Error while opening file in editor. Could not open document. No workspace mapping was found for 'https://dev.example.com/static/common.css'.

Here's my launch.json:

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Launch Microsoft Edge and open the Edge DevTools",
            "request": "launch",
            "type": "vscode-edge-devtools.debug",
            "url": "https://dev.example.com/",
            "webRoot": "${workspaceFolder}",
            "pathMapping": {
                "/": "${workspaceFolder}/",
                "https://dev.example.com/": "${workspaceFolder}/",
                "https://dev.example.com/static/common.css": "${workspaceFolder}/static/common.css",
            }
        }
    ]
}

OS: MacOS Big Sur 11.6.1 (20G224)

VS Code info:

Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:37:28.172Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

Local Extensions:
Microsoft Edge Tools for VS Code v1.4.2
Remote - SSH v0.70.0

Edge is Version 97.0.1072.55 (Official build) (x86_64)

Remote - SSH is connected to Ubuntu 20.04.3 LTS (Focal Fossa)

@riks1233
Copy link
Author

Thank you!

@AlfredoDinunzioTR
Copy link

I am still having this exact same issue. I cannot tell if this is user-error, since the issue looks like it should be resolved. Or if it is regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked
Projects
None yet
4 participants