bit icon indicating copy to clipboard operation
bit copied to clipboard

Cannot read properties of undefined (reading 'legacyScope')

Open dzakki opened this issue 1 year ago • 4 comments

Describe the bug

got error when creating a new lane

Steps to Reproduce

  1. bit lane create my-lane --scope @ichigo-kurosaki.my-first-lane
  2. got error Cannot read properties of undefined (reading 'legacyScope')

Expected Behavior

successfully added and checked out to a new lane my-lane

Screenshots, exceptions and logs

Screenshot 2023-12-16 at 15 49 55

If applicable, add screenshots, exceptions, and logs to help explain your problem.

Specifications

  • Bit version: 1.5.13
  • Workspace type: (harmony/legacy)
  • Node version: v20.10.0
  • npm / yarn version:10.2.3
  • Platform: Mac os M1 ventura 13.3.1

dzakki avatar Dec 16 '23 08:12 dzakki

Please run it again then attach the debug.log. You can find its location by running bit globals command

GiladShoham avatar Dec 16 '23 19:12 GiladShoham

hi, where did you get the syntax to add @ for the scope name? please run

bit lane create my-lane --scope ichigo-kurosaki.my-first-lane

also, if you have defaultScope set in your workspace.jsonc, the lane create command will use it by default.

itaymendel avatar Dec 17 '23 16:12 itaymendel

Please run it again then attach the debug.log. You can find its location by running bit globals command

here the log bro @GiladShoham

MacBook-Pro-2 lane % bit lane create my-lane --scope ichigo-kurosaki.my-first-lane  --log
*** Loading Bit *** argv:
/Users/learn/.bvm/nodejs/20.10.0/bin/node
/Users/learn/.bvm/links/bit/node_modules/@teambit/bit/bin/bit
lane
create
my-lane
--scope
ichigo-kurosaki.my-first-lane
--log
[*] started a new command: "create" with the following data:
    args: [
      "my-lane"
    ]
    flags: {
      "scope": "ichigo-kurosaki.my-first-lane",
      "log": true,
      "lane-name": "my-lane",
      "laneName": "my-lane"
    }
got an error from command create: TypeError: Cannot read properties of undefined (reading 'legacyScope')
    err: {
      "type": "TypeError",
      "message": "Cannot read properties of undefined (reading 'legacyScope')",
      "stack":
          TypeError: Cannot read properties of undefined (reading 'legacyScope')
              at createLaneInScope (/Users/learn/.bvm/versions/1.5.13/bit-1.5.13/node_modules/@teambit/lanes/dist/create-lane.js:115:29)
              at LanesMain.createLane (/Users/learn/.bvm/versions/1.5.13/bit-1.5.13/node_modules/@teambit/lanes/dist/lanes.main.runtime.js:414:65)
              at LaneCreateCmd.report (/Users/learn/.bvm/versions/1.5.13/bit-1.5.13/node_modules/@teambit/lanes/dist/lane.cmd.js:230:37)
              at async CommandRunner.runReportHandler (/Users/learn/.bvm/versions/1.5.13/bit-1.5.13/node_modules/@teambit/cli/dist/command-runner.js:157:20)
              at async CommandRunner.runCommand (/Users/learn/.bvm/versions/1.5.13/bit-1.5.13/node_modules/@teambit/cli/dist/command-runner.js:98:16)
    }
Cannot read properties of undefined (reading 'legacyScope')
[+] CLI-OUTPUT: Cannot read properties of undefined (reading 'legacyScope')
[*] the command "create" has been terminated with an error code 1

dzakki avatar Dec 18 '23 02:12 dzakki

hi, where did you get the syntax to add @ for the scope name? please run

@itaymendel i tried by removing the @ but still not working.

at that case i want to create a new scope for my lane, so i dont need to use defaulf scope, right ?

dzakki avatar Dec 18 '23 02:12 dzakki

If you won't specify the scope it will create it in the default scope as configured in the workspace.jsonc file. Can you please check if this still happens with the latest version of bit? @davidfirst fyi

GiladShoham avatar Apr 21 '24 09:04 GiladShoham

I just tried no errors. There is another bug which let you running the command above with the invalid @ character. I'll take care of this.

davidfirst avatar Apr 22 '24 13:04 davidfirst