Open snk7891 opened 2 years ago
Hi! 👋
This issue looks stale, and doesn't feature the reproducible
label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).
Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃
If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded
label. Thanks for helping us triaging our repository! 🌟
Hi @snk7891, I encountered the same issue as you, and made a reproduction using yarn playground. According to the above message, it must be included in the first post. Could you add it? Just copy-paste this in your post:
```js repro
const installPromise = packageJsonAndInstall({
"name": "example-yarn-package",
"version": "1.0.1",
"description": "An example package to demonstrate Yarn"
});
const versionPromise = yarn(`version`, `preminor`);
await expect(versionPromise).resolves.toBeTruthy();
---
[Playground](https://yarnpkg.com/playground?code=Y29uc3QgaW5zdGFsbFByb21pc2UgPSBwYWNrYWdlSnNvbkFuZEluc3RhbGwoewogICJuYW1lIjogImV4YW1wbGUteWFybi1wYWNrYWdlIiwKICAidmVyc2lvbiI6ICIxLjAuMSIsCiAgImRlc2NyaXB0aW9uIjogIkFuIGV4YW1wbGUgcGFja2FnZSB0byBkZW1vbnN0cmF0ZSBZYXJuIgp9KTsKCmNvbnN0IHZlcnNpb25Qcm9taXNlID0geWFybihgdmVyc2lvbmAsIGBwcmVtaW5vcmApOwoKYXdhaXQgZXhwZWN0KHZlcnNpb25Qcm9taXNlKS5yZXNvbHZlcy50b0JlVHJ1dGh5KCk7Cg%3D%3D)
```js repro
const installPromise = packageJsonAndInstall({
"name": "example-yarn-package",
"version": "1.0.1",
"description": "An example package to demonstrate Yarn"
});
const versionPromise = yarn(`version`, `preminor`);
await expect(versionPromise).resolves.toBeTruthy();
Output:
Error: [2mexpect([22m[31mreceived[39m[2m).[22mresolves[2m.[22mtoBeTruthy[2m()[22m
Received promise rejected instead of resolved
Rejected to value: [31m[Error: Command failed: /home/sandbox/.nvm/versions/node/v16.12.0/bin/node /sandbox/berry/scripts/actions/../run-yarn.js version preminor·[39m
[31m[31m[1mUsage Error[22m[31m: Invalid value for enumeration: "preminor" (expected one of "decline", "major", "minor", "patch", "prerelease")·[39m
[31m[1m$ [22myarn version [-d,--deferred] [-i,--immediate] <strategy>[39m
[31m][39m
at expect (/sandbox/node_modules/expect/build/index.js:138:15)
at module.exports (evalmachine.<anonymous>:10:7)
at /sandbox/node_modules/@arcanis/sherlock/lib/executeRepro.js:57:19
at executeInTempDirectory (/sandbox/node_modules/@arcanis/sherlock/lib/executeRepro.js:18:22)
at executeRepro (/sandbox/node_modules/@arcanis/sherlock/lib/executeRepro.js:25:18)
at module.exports../pages/api/sherlock.js.__webpack_exports__.default (/sandbox/.next/server/static/development/pages/api/sherlock.js:140:122)
at Object.apiResolver (/sandbox/node_modules/next/dist/next-server/server/api-utils.js:46:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async DevServer.handleApiRequest (/sandbox/node_modules/next/dist/next-server/server/next-server.js:449:9)
at async Object.fn (/sandbox/node_modules/next/dist/next-server/server/next-server.js:371:37)
at async Router.execute (/sandbox/node_modules/next/dist/next-server/server/router.js:134:32)
at async DevServer.run (/sandbox/node_modules/next/dist/next-server/server/next-server.js:491:29)
at async DevServer.handleRequest (/sandbox/node_modules/next/dist/next-server/server/next-server.js:144:20)
This issue reproduces on master:
Error: expect(received).resolves.toBeTruthy()
Received promise rejected instead of resolved
Rejected to value: [Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js version preminor
Usage Error: Invalid value for enumeration: "preminor" (expected one of "decline", "major", "minor", "patch", "prerelease")
$ yarn version [-d,--deferred] [-i,--immediate] <strategy>
]
at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-44ff9ab1e7.zip/node_modules/expect/build/index.js:138:15)
at module.exports (evalmachine.<anonymous>:10:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:57:13
at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:18:16)
at async executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:25:12)
at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:26:38)
at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)
@cvolant Thanks for the reproduction, I've updated the OP to include it.
same issue with yarn 3.2.2:
$ yarn version prepatch
Usage Error: Invalid value for enumeration: "prepatch" (expected one of "decline", "major", "minor", "patch", "prerelease")
$ yarn version [-d,--deferred] [-i,--immediate] <strategy>
» yarn --version
3.2.2
Reproducing on 4.1.1
This is strange because the docs explicitly mention "premajor"
Should we update the docs in the meantime until this is supported?
Still an issue for v4.2.2
Still an issue for v4.5.1
Self-service
Describe the bug
According to the inline help:
But none of the
premajor
,preminor
,prepatch
strategies work, and they all return the following error:To reproduce
Environment
Thanks!