vs-deploy icon indicating copy to clipboard operation
vs-deploy copied to clipboard

[Help Wanted] [Error] Could not deploy file '<file>': Error: Could not get relative path for <file>

Open joaociocca opened this issue 7 years ago • 5 comments

I have no idea what I'm doing wrong here. I went from a single folder workspace to a dual setup, one for dev, other for prd. Settings.json has both configurations, but I'm getting this error when I try to deploy a .jpg file inside /dev/img folder.

joaociocca avatar Dec 18 '17 19:12 joaociocca

@joaociocca

Can you post an example of your settings?

mkloubert avatar Dec 21 '17 18:12 mkloubert

Sorry, I forgot to do that and reverted to single folder... but I think I remember what I did, I can explain: base folder, something like C:\Project, contained a \dev and \prd folders. I opened them together on Code, and tried to setup two different targets - one for \dev deploy and the other for \prd, but when I tried to just deploy, nothing happened. Then I tried to deploy only that .jpg file, and the "Could not deploy" error showed up.

I'll see if I can get to that point again once I have some free time over here, then I'll post an example!

joaociocca avatar Dec 21 '17 20:12 joaociocca

I have the same issue. Uploading from within a single project directory works ok, but when I move the directory into a workspace it errors with "Could not get relative path for.."

beebase avatar Oct 25 '18 22:10 beebase

I can confirm this behaviour. I have a big workspace with more or less 30-40 folders in it. I'm trying to set up deployment but get the same error when trying to deploy:

[Error] Could not deploy file '<file>': Error: Could not get relative path for <file>

The <file> is the absolute path of the file.

My deploy-config inside of workspace's settings.js:

"deploy": {
        "packages": [
            {
                "name": "module",
                "description": "app module",
                "files": [
                    "src/**/*",
                    "bin/*",
                    "plugin/*"
                ],
                "deployOnChange": true,
                "targets": [
                    "local wmware"
                ],
                
            }
        ],
        "targets": [
            {
                "type": "sftp",
                "name": "local vmware",
                "description": "A SFTP folder",
                "host": "192.168.73.137",
                "port": 22,
                "user": "root",
                "password": "***",
                "dir": "/opt",
                "mappings": [
                    {
                        "source": "src/frontend",
                        "target": "/opt/app/frontend/modules/module"
                    }
                ]
            }
        ]
    }

Using this config inside the single module folder works fine.

pyriand3r avatar Nov 30 '18 07:11 pyriand3r

Just tested. It works in deploy reloaded.

pyriand3r avatar Nov 30 '18 08:11 pyriand3r