trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

[TRI-1392] yarn dlx @trigger.dev/cli@latest init fails

Open matt-aitken opened this issue 1 year ago • 5 comments

It seems to have an issue with the mock-fs package. This package needs to be in dependencies because of how we've setup some of the tests.

To reproduce

Run yarn dlx @trigger.dev/cli@latest init in a blank Next.js project.

NOTE: this is only an issue with Yarn.

You'll see this output:

yarn dlx @trigger.dev/cli@latest init
➤ YN0000: ┌ Resolution step
➤ YN0032: │ fsevents@npm:2.3.3: Implicit dependencies on node-gyp are discouraged
➤ YN0000: └ Completed in 5s 870ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ ngrok@npm:5.0.0-beta.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 0s 919ms
➤ YN0000: Done with warnings in 6s 937ms

/Users/matt/.yarn/berry/cache/mock-fs-npm-5.2.0-5103a7b507-8.zip/node_modules/mock-fs/lib/readfilecontext.js:43
  const origRead = prototype.read;
                             ^

TypeError: Cannot read properties of undefined (reading 'read')
    at exports.patchReadFileContext (/Users/matt/.yarn/berry/cache/mock-fs-npm-5.2.0-5103a7b507-8.zip/node_modules/mock-fs/lib/readfilecontext.js:43:30)
    at Object.<anonymous> (/Users/matt/.yarn/berry/cache/mock-fs-npm-5.2.0-5103a7b507-8.zip/node_modules/mock-fs/lib/index.js:57:1)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
    at Object.require$$0.Module._extensions..js (/private/var/folders/6d/6cqqr2456_z22rz84zx9t8500000gn/T/xfs-2fbd7429/dlx-62739/.pnp.cjs:13867:33)
    at Module.load (node:internal/modules/cjs/loader:1043:32)
    at Function.require$$0.Module._load (/private/var/folders/6d/6cqqr2456_z22rz84zx9t8500000gn/T/xfs-2fbd7429/dlx-62739/.pnp.cjs:13686:22)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

From SyncLinear.com | TRI-1392

matt-aitken avatar Oct 10 '23 14:10 matt-aitken

can I take up this issue? Thanks

shreyas0512 avatar Oct 10 '23 15:10 shreyas0512

@matt-aitken I tried npx @trigger.dev/cli@latest init and pnpm dlx @trigger.dev/cli@latest init both worked fine for me without any issues. But while running yarn dlx @trigger.dev/cli@latest init I am facing different issue dlx Command not found.

So is this only reproducible with yarn dlx ?

RamK777-stack avatar Oct 11 '23 03:10 RamK777-stack

Yes, this is only an issue with yarn @RamK777-stack

matt-aitken avatar Oct 11 '23 14:10 matt-aitken

@shreyas0512 sorry but we’re not assigning issues, we’ll accept the best PR for an issue (not necessarily the first PR either). Triaging assignments during hacktoberfest doesn’t scale.

matt-aitken avatar Oct 11 '23 14:10 matt-aitken

@matt-aitken , It looks like this has been resolved. I have tried this today but trigger.dev package got installed successfully in fresh next.js project. Is there any specifics that I need look for?

meetwithyash avatar Dec 18 '23 09:12 meetwithyash