Skip to content

Yarn workspace does not propagate flags #7776

Closed
@thevojacek

Description

@thevojacek

When using yarn workspaces with run command, flags are not passes into executed command.

How to reproduce:

yarn workspace test_workspace run start -- \
  serverURL="hello" \
  awsAccessKey="world"

package.json file contents.

{
  "scripts":
  {
    "start": "node script.js""
  }
}

Current behavior:

Flags are not passed into the running script.

Expected behavior:

Flags should be passed.

Environment

Node: 12.13.1
Yarn: 1.21.1
OS: macOS 10.14.6

Activity

rally25rs

rally25rs commented on Dec 28, 2019

@rally25rs
Contributor

confirmed against v1.21.1.

I'll try to see what's up with it. It's a bit tricky because yarn runs child process yarn runs child process node scripts.js so the flags have to get passed through a couple places.

self-assigned this
on Dec 28, 2019
rally25rs

rally25rs commented on Dec 28, 2019

@rally25rs
Contributor

@thevojacek as a workaround, if you remove the -- then the parameters are passed correctly.
It looks like yarn trims off args after -- for some commands, including workspace.

added a commit that references this issue on Dec 29, 2019
0507b95
thevojacek

thevojacek commented on Dec 29, 2019

@thevojacek
Author

@thevojacek as a workaround, if you remove the -- then the parameters are passed correctly.
It looks like yarn trims off args after -- for some commands, including workspace.

Thank you for investigation!

added a commit that references this issue on Dec 29, 2019
7769fb1
added a commit that references this issue on Jan 22, 2020
1b334e6
added 2 commits that reference this issue on Jun 10, 2020
ef509d5
bd17123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @rally25rs@thevojacek

    Issue actions

      Yarn workspace does not propagate flags · Issue #7776 · yarnpkg/yarn