#All funcs fail in new TS project with pnpm

1 messages · Page 1 of 1 (latest)

weak crescent
#

I just added dagger to a project to test out, and it's giving the following error. I have "packageManager": "pnpm@9.6.0", but you'll notice the below error prefixes my value with yarn@, then fails. I searched the chat and repo for this issue, but I only seem to come across similar issues.

> dagger call grepDir

Full trace at https://dagger.cloud/mikestopcontinues/traces/54e26703c78f2f26bb343cd94da7d8f0

✔ connect 1.1s
✘ initialize 6.2s
! input: module.withSource.initialize resolve: failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1
  ✘ installing module 6.1s
  ! input: module.withSource.initialize resolve: failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1
    ✔ ModuleSource.resolveFromCaller: ModuleSource! 4.3s
    ✔ ModuleSource.asModule: Module! 1.3s
    ✘ Module.initialize: Module! 0.5s
    ! failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1

Error: input: module.withSource.initialize resolve: failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1

Stderr:
error This project's package.json defines "packageManager": "yarn@pnpm@9.6.0". However the current global version of Yarn is 1.22.22.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
deep fulcrum
weak crescent
#

Hey @deep fulcrum , I started with a subdirectory install, so I tried in the root of my monorepo instead, and I got a new error:

> dagger run containerEcho "hi"

Full trace at https://dagger.cloud/mikestopcontinues/traces/ab57ed0e7588329c5128baceb28d9c71

✔ connect 1.2s
Error: exec: "containerEcho": executable file not found in $PATH
#

However, when I run dagger functions, I get the old error:

Full trace at https://dagger.cloud/mikestopcontinues/traces/4d1e9c6c957c5431742eb79d4b96b1f8

✔ connect 1.2s
✘ initialize 1m41.7s
! input: module.withSource.initialize resolve: failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1
  ✘ installing module 1m41.6s
  ! input: module.withSource.initialize resolve: failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1
    ✔ ModuleSource.resolveFromCaller: ModuleSource! 50.0s
    ✔ ModuleSource.asModule: Module! 35.4s
    ✘ Module.initialize: Module! 16.2s
    ! failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1

Error: input: module.withSource.initialize resolve: failed to initialize module: failed to call module "core" to get functions: call constructor: process "yarn install" did not complete successfully: exit code: 1

Stderr:
error This project's package.json defines "packageManager": "yarn@pnpm@9.6.0". However the current global version of Yarn is 1.22.22.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
deep fulcrum
#

@weak crescent do you currently have a sub-directory?

#

can you show me what your dagger.json looks like?

weak crescent
#

It's in a subdirectory now. Here's the contents:

{
  "name": "core",
  "sdk": "typescript",
  "source": "dagger",
  "engineVersion": "v0.12.4"
}
deep fulcrum
#

there shouldn't be any packageManager in that package.json

weak crescent
#

There isn't. But there is packageManager in my root package.json. I've also tried to make this with/without adding the dagger subdir to my pnpm-workspace.yaml. Neither works.

#
{
  "dependencies": {
    "typescript": "^5.3.2",
    "@dagger.io/dagger": "./sdk"
  }
}
deep fulcrum
#

could you please remove the dagger dependencies from your main project package.json and create a package.json file in your ./dagger folder with the contents you shared above?

#

that should fix it