Skip to content

Wrong warning while the output path is outside the extension folder. #114371

@vchirikov

Description

@vchirikov

Hi.
I have a project structure like this:

c:\code\⬛⬛⬛\vscode-extension  # root of the workspace/reporoot
c:\code\⬛⬛⬛\vscode-extension\src\extension # root of the vscode extension
c:\code\⬛⬛⬛\vscode-extension\artifacts\extension # output of webpack

my configs:

c:\code\⬛⬛⬛\vscode-extension\src\extension\tsconfig.json:

{
// ...
  "outDir": "../../artifacts/obj/extension/tsc/",
}

c:\code\⬛⬛⬛\vscode-extension\src\extension\package.json:

{
// ...
"main": "../../artifacts/extension/extension.js",
}

And I've got warning like this:

[c:\code\⬛⬛⬛\vscode-extension\src\extension\]: Expected `main` (c:\code\⬛⬛⬛\vscode-extension\artifacts\extension\extension.js) to be included inside extension's folder (c:\code\⬛⬛⬛\vscode-extension\src\extension\). This might make the extension non-portable.

As you can see the main is not included inside extension's folder.

The problem is here:

if (!normalizedAbsolutePath.startsWith(extensionFolderPath)) {
notices.push(nls.localize('extensionDescription.main2', "Expected `main` ({0}) to be included inside extension's folder ({1}). This might make the extension non-portable.", normalizedAbsolutePath, extensionFolderPath));
// not a failure case

Metadata

Metadata

Assignees

Labels

*questionIssue represents a question, should be posted to StackOverflow (VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions