Skip to content

Conversation

@yuzheng14
Copy link

When running vsce pack or vsce ls in a monorepo or workspace setup, duplicate files may appear in the packaged file list leading to pack fail.

image

This is because the internal dependency collection uses the output of:

npm list --production --parseable --depth=99999 --loglevel=error
image

However, this command always includes the project root directory as the first line of its output. As a result, when we later glob for files in each dependency directory, the root directory is also globbed, causing all files (including those in subdirectories like node_modules in sub packages) to be collected multiple times.

vscode-vsce/src/package.ts

Lines 1671 to 1675 in 294d71b

const promises = deps.map(dep =>
glob('**', { cwd: dep, nodir: true, follow: followSymlinks, dot: true, ignore: 'node_modules/**' }).then(files =>
files.map(f => path.relative(cwd, path.join(dep, f))).map(f => f.replace(/\\/g, '/'))
)
);

You can reproduce this at yuzheng14/valype (temporarily it would exist in feat/vscode-extension branch only).

Fixes #812

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERROR: The following files have the same case insensitive path, which isn't supported by the VSIX format

1 participant