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

[Bug?]: @yarnpkg/plugin-version -> versionUtils import undefined #3595

Closed
1 task done
liamawhite opened this issue Oct 19, 2021 · 1 comment
Closed
1 task done

[Bug?]: @yarnpkg/plugin-version -> versionUtils import undefined #3595

liamawhite opened this issue Oct 19, 2021 · 1 comment
Labels
bug Something isn't working stale Issues that didn't get attention

Comments

@liamawhite
Copy link

liamawhite commented Oct 19, 2021

Self-service

  • I'd be willing to implement a fix

Describe the bug

Pretty sure this is my own incompetence and not a bug but... I'm trying to write my own plugin and want to import the versionUtils. My IDE recognises them but when I run the command I get:

Type Error: Cannot read property 'openVersionFile' of undefined

This is using a fresh builder project. I suspect something is not getting bundled somewhere.

To reproduce

import { Plugin } from '@yarnpkg/core';
import { BaseCommand } from '@yarnpkg/cli';
import { versionUtils } from '@yarnpkg/plugin-version'

class ReleaseCommand extends BaseCommand {
  static paths = [
    ['release-check'],
  ];
  async execute() {
	// In my code I'm actually calling functions but this is an easy repro.
    console.log(versionUtils)  
  } 
}

const plugin: Plugin = {
  commands: [
    ReleaseCommand,
  ],
};

export default plugin;
{
  "name": "yarn-plugin-release-check",
  "main": "./sources/index.ts",
  "dependencies": {
    "@types/node": "^15.0.0",
    "@yarnpkg/builder": "^3.0.1",
    "@yarnpkg/cli": "^3.0.1-rc.1",
    "@yarnpkg/core": "^3.0.0",
    "@yarnpkg/plugin-version": "3.0.0",
    "clipanion": "^3.0.1",
    "typescript": "^4.3.2"
  },
  "scripts": {
    "build": "builder build plugin"
  }
}
yarn build && yarn release-check
➤ YN0000: ┌ Building @yarnpkg/plugin-release-check
➤ YN0000: └ Completed in 1s 108ms

➤ YN0000: ✓ Done building @yarnpkg/plugin-release-check!
➤ YN0000: ? Bundle path: <redacted>/plugin-release-check.js
➤ YN0000: ? Bundle size: 1.08 KB
undefined

Environment

System:
    OS: macOS 11.6
    CPU: (8) x64 Apple M1
  Binaries:
    Node: 15.12.0 - /private/var/folders/9r/by9bv60j729_wcsxd86fwv480000gn/T/xfs-ff62c657/node
    Yarn: 3.0.2 - /private/var/folders/9r/by9bv60j729_wcsxd86fwv480000gn/T/xfs-ff62c657/yarn
    npm: 7.6.3 - ~/.nvm/versions/node/v15.12.0/bin/npm
@liamawhite liamawhite added the bug Something isn't working label Oct 19, 2021
@yarnbot
Copy link
Collaborator

yarnbot commented Nov 19, 2021

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! 🌟

@yarnbot yarnbot added the stale Issues that didn't get attention label Nov 19, 2021
@yarnbot yarnbot closed this as completed Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that didn't get attention
Projects
None yet
Development

No branches or pull requests

2 participants