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: EWORKSPACESCONFIG workspaces config expects an Array in yarn package.json with nohoist #1594

Open
goleary opened this issue Jan 9, 2025 · 2 comments

Comments

@goleary
Copy link
Contributor

goleary commented Jan 9, 2025

Provide environment information

System:
OS: macOS 15.1
CPU: (10) arm64 Apple M2 Pro
Memory: 89.38 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
Yarn: 1.22.19 - ~/Documents/GitHub/andytown/node_modules/.bin/yarn
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
pnpm: 9.10.0 - ~/Library/pnpm/pnpm
Watchman: 2024.09.09.00 - /opt/homebrew/bin/watchman

Describe the bug

In a project with a valid yarn packages.json that has a valid workspaces config:

  "workspaces": {
    "nohoist": [
      "react"
    ]
  },

an error is produced when try to run trigger dev

Reproduction repo

below

To reproduce

  1. create new a new trigger project
  2. Add workspaces object as below
  ...
  "workspaces": {
    "nohoist": [
      "react"
    ]
  },
  ...
}
  1. run npx trigger.dev@latest dev

error=>

npm ERR! code EWORKSPACESCONFIG
npm ERR! workspaces config expects an Array

Additional information

Would be sweet if y'all provided a template stackblitz/codesandbox in this issue template for augmentation

@goleary goleary changed the title bug: EWORKSPACESCONFIG workspaces config expects an Array bug: EWORKSPACESCONFIG workspaces config expects an Array in yarn package.json Jan 9, 2025
@goleary goleary changed the title bug: EWORKSPACESCONFIG workspaces config expects an Array in yarn package.json bug: EWORKSPACESCONFIG workspaces config expects an Array in yarn package.json with nohoist Jan 9, 2025
@matt-aitken
Copy link
Member

This looks like it's trying to use npm and not yarn to run the resolved the dependencies.

Do you have a yarn lock file? If you do we should detect that you're using yarn and install packages with that.

If you don't have a yarn lock file we use the package manager that you run the command with, e.g. npx = npm. But it looks like with yarn 1.x there's no equivalent of npx… 🤦

@goleary
Copy link
Contributor Author

goleary commented Jan 15, 2025

Yeah, there is a yarn.lock file at the root of the repo. I started running the commands using the locally installed version, via yarn trigger dev etc, but doing so doesn't resolve my issue, the package.json still seem to not be parsable by trigger :/

I also tried running yarn trigger deploy from the root of the repo (instead of from the sub app where trigger is being used) and specifying the config and env, but when i do this I run into this error:

#18 ERROR: process "/bin/sh -c node node_modules/prisma/build/index.js generate --schema=./prisma/schema.prisma --generator=client" did not complete successfully: exit code: 1
...
#18 0.996 error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).

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

No branches or pull requests

2 participants