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

vsce verify-pat does not seem to use publisher from package.json #341

Closed
scarf005 opened this issue Oct 15, 2022 · 20 comments
Closed

vsce verify-pat does not seem to use publisher from package.json #341

scarf005 opened this issue Oct 15, 2022 · 20 comments
Assignees
Labels

Comments

@scarf005
Copy link

scarf005 commented Oct 15, 2022

Log

pnpx vsce verify-pat scarf --pat $VSCE_PAT
The Personal Access Token verification succeeded for the publisher 'scarf'.

pnpx semantic-release
Error: Command failed with ENOENT: vsce verify-pat
spawn vsce ENOENT
AggregateError: 
    SemanticReleaseError: Invalid vsce token. Additional information:
    Error: Command failed with ENOENT: vsce verify-pat
    spawn vsce ENOENT

I've correctly set up publisher as scarf in my package.json, however it fails with an error.

@felipecrs
Copy link
Owner

Can you try running vsce verify-pat in your command line to check the validity of your token?

@felipecrs
Copy link
Owner

Oh, I think you did already. Thanks.

@felipecrs
Copy link
Owner

This may be an incompatibility with pnpm. Can you try using npm just to confirm?

@scarf005
Copy link
Author

would it be okay to just change to npx? or should i change the whole workflow to use npm?

@felipecrs
Copy link
Owner

would it be okay to just change to npx? or should i change the whole workflow to use npm?

It would work if it were yarn, but I'm not sure for pnpm. That's because, AFAIK, pnpm builds the node_modules folder by using symlinks instead of actual files.

@felipecrs
Copy link
Owner

We have found a similar issue earlier:

@felipecrs felipecrs self-assigned this Oct 15, 2022
@felipecrs felipecrs added the bug label Oct 15, 2022
@scarf005
Copy link
Author

oh, maybe it could be relevent, on pnpm vsce must be ran with --no-dependencies

@felipecrs
Copy link
Owner

felipecrs commented Oct 15, 2022

You can try it to disable dependencies, check:

@felipecrs
Copy link
Owner

felipecrs commented Oct 15, 2022

I also noticed that your devDependencies misses semantic-release, it's a peer dependency (required).

@felipecrs
Copy link
Owner

Do you see that when you ran pnpx vsce verify-pat, pnpm actually installed the vsce package before running it? Ideally it was supposed to be preinstalled (installed as part of pnpm install). This is weird.

Nevertheless, try replacing your pnpx semantic-release line with:

PATH="${PWD}/node_modules/.bin:${PATH}" pnpx semantic-release

I suspect that it may fix the issue.

@felipecrs
Copy link
Owner

I also noticed that your devDependencies misses semantic-release, it's a peer dependency (required).

Try this first though. This would explain why pnpx downloads semantic-release before running it.

@scarf005
Copy link
Author

I tried adding devDependencies, but it did not work.

will try using the path method.

@scarf005
Copy link
Author

alright, it still fails but vsce-pat works.

@scarf005
Copy link
Author

https://github.com/scarf005/Cataclysm-BN-tools/actions/runs/3256670022/jobs/5347399236

I wonder why this error happens:

  • vscode:prepublish succeeds with out/main.js 639b
  • in package.json main script is defined as "main": "./out/main.js"
  • but semantic-release tries to find it in extensions
Extension entrypoint(s) missing. Make sure these files exist and aren't ignored by '.vscodeignore':
  extension/out/main.js

@scarf005
Copy link
Author

oh nevermind, it indeed was .vscodeignore problem.
thanks for your support!

@felipecrs
Copy link
Owner

Just to summarize, you had to put PATH in the command line. Right?

@scarf005
Copy link
Author

scarf005 commented Oct 16, 2022

wait, for some reason this workflow file worked without setting up PATH: https://github.com/scarf005/Cataclysm-BN-tools/actions/runs/3258033799/workflow

some differences i could think of is that

  1. I've ran the command semantic-release as package.json script instead of pnpx. It may have fixed node_modules.
  2. I've set "private": true in package.json. it might have affected semantic-release-vsce.

@felipecrs
Copy link
Owner

I think it's the first measure which actually fixed the issue.

@felipecrs
Copy link
Owner

pnpx is deprecated, I think it can be changed to pnpm exec:

https://pnpm.io/6.x/pnpx-cli

I suspect it would work this way.

@felipecrs
Copy link
Owner

Hey @scarf005, I published v5.2.2 which contains a potential fix for this issue. Would you mind testing it? Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants