diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx index 85e660933e..3be620065f 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx @@ -1155,7 +1155,7 @@ function ConnectedDevWarning() { Runs usually start within 2 seconds in{" "} . Check you're running the - CLI: npx trigger.dev@beta dev + CLI: npx trigger.dev@latest dev diff --git a/docs/cli-deploy-commands.mdx b/docs/cli-deploy-commands.mdx index 2ced0fdcad..ba334ae3b3 100644 --- a/docs/cli-deploy-commands.mdx +++ b/docs/cli-deploy-commands.mdx @@ -1,6 +1,6 @@ --- title: "CLI deploy options" -sidebarTitle: "Deploy" +sidebarTitle: "deploy" description: "Use these options to help deploy your tasks to Trigger.dev." --- diff --git a/docs/cli-deploy.mdx b/docs/cli-deploy.mdx index fc40005f38..77b4f17655 100644 --- a/docs/cli-deploy.mdx +++ b/docs/cli-deploy.mdx @@ -3,9 +3,6 @@ title: "CLI deploy command" description: "The `trigger.dev deploy` command can be used to manually deploy." --- -import ComingSoon from '/snippets/coming-soon-generic.mdx'; import CliDeployCommands from '/snippets/cli-commands-deploy.mdx'; - -{/* todo add options, remove the reference docs */} diff --git a/docs/cli-dev-commands.mdx b/docs/cli-dev-commands.mdx index cc9d76ab5d..b9152578f1 100644 --- a/docs/cli-dev-commands.mdx +++ b/docs/cli-dev-commands.mdx @@ -1,6 +1,6 @@ --- title: "CLI dev command" -sidebarTitle: "Dev" +sidebarTitle: "dev" description: "The `trigger.dev dev` command is used to run your tasks locally." --- diff --git a/docs/cli-init-commands.mdx b/docs/cli-init-commands.mdx index 5329404ae0..b5da8e18e8 100644 --- a/docs/cli-init-commands.mdx +++ b/docs/cli-init-commands.mdx @@ -1,9 +1,11 @@ --- title: "CLI init command" -sidebarTitle: "Init" +sidebarTitle: "init" description: "Use these options when running the CLI `init` command." --- +import CommonOptions from '/snippets/cli-options-common.mdx'; + Run the command like this: @@ -49,25 +51,8 @@ yarn dlx trigger.dev@latest init Additional arguments to pass to the package manager. Accepts CSV for multiple args. - - The login profile to use. Defaults to "default". - +### Common options - - Override the default API URL. If not specified, it uses `https://api.trigger.dev`. - - - - The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This - does not affect the log level of your trigger.dev tasks. Defaults to "log". - +These options are available on most commands. - - Opt-out of sending telemetry data. - - -## Standard options - - - Shows the help information for the command. - + diff --git a/docs/cli-introduction.mdx b/docs/cli-introduction.mdx index b718f02021..1db2f537cf 100644 --- a/docs/cli-introduction.mdx +++ b/docs/cli-introduction.mdx @@ -3,25 +3,23 @@ title: "Introduction" description: "The Trigger.dev CLI has a number of options and commands to help you develop locally, self host, and deploy your tasks." --- -## Standard options +import HelpOption from '/snippets/cli-options-help.mdx'; +import VersionOption from '/snippets/cli-options-version.mdx'; - - Displays a list of all help commands. - +## Options - - Displays the version number. - + + ## Commands -| Command | Description | -| :------------------------------------------------------- | :--------------------------------------------------------------------- | -| [Login](/cli-login-commands) | Login with Trigger.dev so you can perform authenticated actions. | -| [Init](/cli-init-commands) | Initialize your existing project for development with Trigger.dev. | -| [Dev](/cli-dev-commands) | Run your Trigger.dev tasks locally. | -| [Deploy](/cli-deploy-commands) | Deploy your Trigger.dev v3 project to the cloud. | -| [Whoami](/cli-whoami-commands) | Display the current logged in user and project details. | -| [Logout](/cli-logout-commands) | Logout of Trigger.dev. | -| [List-profiles](/cli-list-profiles-commands) | List all of your CLI profiles. | -| [Update](/cli-update-commands) | Updates all `@trigger.dev/*` packages to match the CLI version. | \ No newline at end of file +| Command | Description | +| :------------------------------------------- | :----------------------------------------------------------------- | +| [login](/cli-login-commands) | Login with Trigger.dev so you can perform authenticated actions. | +| [init](/cli-init-commands) | Initialize your existing project for development with Trigger.dev. | +| [dev](/cli-dev-commands) | Run your Trigger.dev tasks locally. | +| [deploy](/cli-deploy-commands) | Deploy your Trigger.dev v3 project to the cloud. | +| [whoami](/cli-whoami-commands) | Display the current logged in user and project details. | +| [logout](/cli-logout-commands) | Logout of Trigger.dev. | +| [list-profiles](/cli-list-profiles-commands) | List all of your CLI profiles. | +| [update](/cli-update-commands) | Updates all `@trigger.dev/*` packages to match the CLI version. | diff --git a/docs/cli-list-profiles-commands.mdx b/docs/cli-list-profiles-commands.mdx index 4687811ae5..0b45fffb5f 100644 --- a/docs/cli-list-profiles-commands.mdx +++ b/docs/cli-list-profiles-commands.mdx @@ -1,9 +1,14 @@ --- -title: "CLI list profiles command" -sidebarTitle: "List profiles" +title: "CLI list-profiles command" +sidebarTitle: "list-profiles" description: "Use these options when using the `list-profiles` CLI command." --- +import LogLevelOption from "/snippets/cli-options-log-level.mdx"; +import SkipTelemetryOption from "/snippets/cli-options-skip-telemetry.mdx"; +import HelpOption from "/snippets/cli-options-help.mdx"; +import VersionOption from "/snippets/cli-options-version.mdx"; + Run the command like this: @@ -24,17 +29,14 @@ yarn dlx trigger.dev@latest list-profiles ## Options - - The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This - does not affect the log level of your trigger.dev tasks. Defaults to `log`. - +### Common options + +These options are available on most commands. + + - - Opt-out of sending telemetry data. - + -## Standard options + - - Shows the help information for the command. - + diff --git a/docs/cli-login-commands.mdx b/docs/cli-login-commands.mdx index d20f9338d7..ed5523639b 100644 --- a/docs/cli-login-commands.mdx +++ b/docs/cli-login-commands.mdx @@ -1,9 +1,11 @@ --- title: "CLI login command" -sidebarTitle: "Login" +sidebarTitle: "login" description: "Use these options when logging in to Trigger.dev using the CLI." --- +import CommonOptions from '/snippets/cli-options-common.mdx'; + Run the command like this: @@ -24,29 +26,8 @@ yarn dlx trigger.dev@latest login ## Options - - Specifies the login profile to use. If not provided, it defaults to "default". - - - - Overrides the default API URL. If not specified, it uses `https://api.trigger.dev`. - - - - Sets the CLI log level. Available options are `debug`, `info`, `log`, `warn`, `error`, and `none`. - This setting doesn't affect the log level of your trigger.dev tasks. The default is `log`. - - - - Opts out of sending telemetry data. - - -## Standard options +### Common options - - Displays the version number of the CLI. - +These options are available on most commands. - - Shows the help information for the command. - + diff --git a/docs/cli-logout-commands.mdx b/docs/cli-logout-commands.mdx index 5b28eb2607..f4c5bc77a9 100644 --- a/docs/cli-logout-commands.mdx +++ b/docs/cli-logout-commands.mdx @@ -1,9 +1,11 @@ --- title: "CLI logout command" -sidebarTitle: "Logout" +sidebarTitle: "logout" description: "Use these options when using the `logout` CLI command." --- +import CommonOptions from '/snippets/cli-options-common.mdx'; + Run the command like this: @@ -24,25 +26,8 @@ yarn dlx trigger.dev@latest logout ## Options - - The login profile to use. Defaults to `default`. - - - - Override the API URL. Defaults to `https://api.trigger.dev`. - - - - The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This - does not affect the log level of your trigger.dev tasks. Defaults to `log`. - - - - Opt-out of sending telemetry data. - +### Common options -## Standard options +These options are available on most commands. - - Shows the help information for the command. - + diff --git a/docs/cli-update-commands.mdx b/docs/cli-update-commands.mdx index 7a07b9d9b2..beaaad0bf3 100644 --- a/docs/cli-update-commands.mdx +++ b/docs/cli-update-commands.mdx @@ -1,9 +1,14 @@ --- title: "CLI update command" -sidebarTitle: "Update" +sidebarTitle: "update" description: "Use these options when using the `update` CLI command." --- +import LogLevelOption from "/snippets/cli-options-log-level.mdx"; +import SkipTelemetryOption from "/snippets/cli-options-skip-telemetry.mdx"; +import HelpOption from "/snippets/cli-options-help.mdx"; +import VersionOption from "/snippets/cli-options-version.mdx"; + Run the command like this: @@ -24,17 +29,14 @@ yarn dlx trigger.dev@latest update ## Options - - The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This - does not affect the log level of your trigger.dev tasks. Defaults to `log`. - +### Common options + +These options are available on most commands. + + - - Opt-out of sending telemetry data. - + -## Standard options + - - Shows the help information for the command. - + diff --git a/docs/cli-whoami-commands.mdx b/docs/cli-whoami-commands.mdx index 1e51d3f733..0c51559bd9 100644 --- a/docs/cli-whoami-commands.mdx +++ b/docs/cli-whoami-commands.mdx @@ -1,9 +1,11 @@ --- title: "CLI whoami command" -sidebarTitle: "Whoami" +sidebarTitle: "whoami" description: "Use these options to display the current logged in user and project details." --- +import CommonOptions from '/snippets/cli-options-common.mdx'; + Run the command like this: @@ -24,25 +26,8 @@ yarn dlx trigger.dev@latest whoami ## Options - - The login profile to use. Defaults to `default`. - - - - Override the API URL. Defaults to `https://api.trigger.dev`. - - - - The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This - does not affect the log level of your trigger.dev tasks. Defaults to `log`. - - - - Opt-out of sending telemetry data. - +### Common options -## Standard options +These options are available on most commands. - - Shows the help information for the command. - + diff --git a/docs/github-actions.mdx b/docs/github-actions.mdx index 385459d349..3951ec0bce 100644 --- a/docs/github-actions.mdx +++ b/docs/github-actions.mdx @@ -77,7 +77,7 @@ jobs: If you already have a GitHub action file, you can just add the final step "🚀 Deploy Trigger.dev" to your existing file. -### Creating a Personal Access Token +## Creating a Personal Access Token @@ -97,6 +97,7 @@ If you already have a GitHub action file, you can just add the final step "🚀 + ## Version pinning The CLI and `@trigger.dev/*` package versions need to be in sync with the `trigger.dev` CLI, otherwise there will be errors and unpredictable behavior. Hence, the `deploy` command will automatically fail during CI on any version mismatches. @@ -122,3 +123,65 @@ Your workflow file will follow the version specified in the `package.json` scrip ``` You should use the version you run locally during dev and manual deploy. The current version is displayed in the banner, but you can also check it by appending `--version` to any command. + + +## Self-hosting + +When self-hosting, you will have to take a few additional steps: + +- Specify the `TRIGGER_API_URL` environment variable. You can add it to the GitHub secrets the same way as the access token. This should point at your webapp domain, for example: `https://trigger.example.com` +- Setup docker as you will need to build and push the image to your registry. On [Trigger.dev Cloud](https://cloud.trigger.dev) this is all done remotely. +- Add your registry credentials to the GitHub secrets. +- Use the `--self-hosted` and `--push` flags when deploying. + +Other than that, your GitHub action file will look very similar to the one above: + + + +```yaml .github/workflows/release-trigger-self-hosted.yml +name: Deploy to Trigger.dev (self-hosted) + +on: + push: + branches: + - main + paths: + - "trigger/**" + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: "20.x" + + - name: Install dependencies + run: npm install + + # docker setup - part 1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # docker setup - part 2 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: 🚀 Deploy Trigger.dev + env: + TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }} + # required when self-hosting + TRIGGER_API_URL: ${{ secrets.TRIGGER_API_URL }} + # deploy with additional flags + run: | + npx trigger.dev@beta deploy --self-hosted --push +``` + + \ No newline at end of file diff --git a/docs/open-source-self-hosting.mdx b/docs/open-source-self-hosting.mdx index 2c005ac88a..c00bad1cf2 100644 --- a/docs/open-source-self-hosting.mdx +++ b/docs/open-source-self-hosting.mdx @@ -3,6 +3,8 @@ title: "Self-hosting" description: "You can self-host Trigger.dev on your own infrastructure." --- +Self-hosting does not support the latest CLI yet, you will have to continue using the `beta` tag for now. + ## Overview @@ -173,8 +175,8 @@ docker login -u 5. You can now deploy v3 projects using the CLI with these flags: -```bash -npx trigger.dev@latest deploy --self-hosted --push +``` +npx trigger.dev@beta deploy --self-hosted --push ``` ## Part 2: Split services @@ -292,10 +294,62 @@ By default, the Trigger.dev webapp sends telemetry data to our servers. This dat TRIGGER_TELEMETRY_DISABLED=1 ``` -## Login via the CLI +## CLI usage + +This section highlights some of the CLI commands and options that are useful when self-hosting. Please check the [CLI reference](/cli-introduction) for more in-depth documentation. + +### Login -To avoid being redirected to the Cloud login page when using the CLI, you can specify the URL of your self-hosted instance with the `-a` flag. For example: +To avoid being redirected to the [Trigger.dev Cloud](https://cloud.trigger.dev) login page when using the CLI, you can specify the URL of your self-hosted instance with the `--api-url` or `-a` flag. For example: +```bash +npx trigger.dev@beta login -a http://trigger.example.com ``` -npx trigger.dev@latest login -a http://example.com + +Once you've logged in, the CLI will remember your login details and you won't need to specify the URL again with other commands. + +#### Custom profiles + +You can specify a custom profile when logging in. This allows you to easily use the CLI with our cloud product and your self-hosted instance at the same time. For example: + +``` +npx trigger.dev@beta login -a http://trigger.example.com --profile my-profile +``` + +You can then use this profile with other commands: + +``` +npx trigger.dev@beta dev --profile my-profile ``` + +To list all your profiles, use the `list-profiles` command: + +``` +npx trigger.dev@beta list-profiles +``` + +#### Verify login + +It can be useful to check you have successfully logged in to the correct instance. You can do this with the `whoami` command, which will also show the API URL: + +```bash +npx trigger.dev@beta whoami + +# with a custom profile +npx trigger.dev@beta whoami --profile my-profile +``` + +### Deploy + +On [Trigger.dev Cloud](https://cloud.trigger.dev), we build deployments remotely and push those images for you. When self-hosting you will have to do that locally yourself. This can be done with the `--self-hosted` and `--push` flags. For example: + +``` +npx trigger.dev@beta deploy --self-hosted --push +``` + +### CI / GitHub Actions + +When running the CLI in a CI environment, your login profiles won't be available. Instead, you can use the `TRIGGER_API_URL` and `TRIGGER_ACCESS_TOKEN` environment +variables to point at your self-hosted instance and authenticate. + +For more detailed instructions, see the [GitHub Actions guide](/github-actions). diff --git a/docs/snippets/cli-args-project-path.mdx b/docs/snippets/cli-args-project-path.mdx new file mode 100644 index 0000000000..72c18f0f6a --- /dev/null +++ b/docs/snippets/cli-args-project-path.mdx @@ -0,0 +1,3 @@ + + The path to the project. Defaults to the current directory. + \ No newline at end of file diff --git a/docs/snippets/cli-commands-deploy.mdx b/docs/snippets/cli-commands-deploy.mdx index 90c625369d..427b7734bd 100644 --- a/docs/snippets/cli-commands-deploy.mdx +++ b/docs/snippets/cli-commands-deploy.mdx @@ -1,3 +1,10 @@ +import ProjectPathArg from '/snippets/cli-args-project-path.mdx'; +import CommonOptions from '/snippets/cli-options-common.mdx'; +import ProjectRefOption from '/snippets/cli-options-project-ref.mdx'; +import EnvFileOption from '/snippets/cli-options-env-file.mdx'; +import ConfigFileOption from '/snippets/cli-options-config-file.mdx'; +import SkipUpdateCheckOption from '/snippets/cli-options-skip-update-check.mdx'; + Run the command like this: @@ -18,7 +25,7 @@ yarn dlx trigger.dev@latest deploy This will fail in CI if any version mismatches are detected. Ensure everything runs locally first - using the [dev](/cli-dev) command and don't bypass the version checks! + using the [dev](/cli-dev-commands) command and don't bypass the version checks! It performs a few steps to deploy: @@ -30,42 +37,47 @@ It performs a few steps to deploy: You can also setup [GitHub Actions](/github-actions) to deploy your tasks automatically. +## Arguments + +``` +npx trigger.dev@latest deploy [path] +``` + + + ## Options - - Defaults to `prod` but you can specify `staging`. - + - - The name of the config file, found where the command is run from. Defaults to `trigger.config.ts`. - + - - Load environment variables from a file. This will only hydrate the `process.env` of the CLI - process, not the tasks. - + - - Create a deployable build but don't deploy it. Prints out the build path so you can inspect it. - + - - Skip checking for `@trigger.dev` package updates. + + Defaults to `prod` but you can specify `staging`. - - The project ref. Required if there is no config file. + + Create a deployable build but don't deploy it. Prints out the build path so you can inspect it. - - The log level to use (debug, info, log, warn, error, none). Defaults to `log`. + + The platform to build the deployment image for. Defaults to `linux/amd64`. Turn off syncing environment variables with the Trigger.dev instance. -## Self-hosting +### Common options + +These options are available on most commands. + + + +### Self-hosting These options are typically used when [self-hosting](/open-source-self-hosting) or for local development. @@ -96,7 +108,9 @@ These options are typically used when [self-hosting](/open-source-self-hosting) Hub, the namespace is your Docker Hub username. -### Push to Docker Hub +## Examples + +### Push to Docker Hub (self-hosted) An example of deploying to Docker Hub when using a self-hosted setup: diff --git a/docs/snippets/cli-commands-develop.mdx b/docs/snippets/cli-commands-develop.mdx index 720526eff1..57e3d8a14a 100644 --- a/docs/snippets/cli-commands-develop.mdx +++ b/docs/snippets/cli-commands-develop.mdx @@ -1,3 +1,10 @@ +import ProjectPathArg from '/snippets/cli-args-project-path.mdx'; +import CommonOptions from '/snippets/cli-options-common.mdx'; +import ProjectRefOption from '/snippets/cli-options-project-ref.mdx'; +import EnvFileOption from '/snippets/cli-options-env-file.mdx'; +import ConfigFileOption from '/snippets/cli-options-config-file.mdx'; +import SkipUpdateCheckOption from '/snippets/cli-options-skip-update-check.mdx'; + This runs a server on your machine that can execute Trigger.dev tasks: @@ -22,43 +29,29 @@ You will see in the terminal that the server is running and listening for tasks. It is worth noting that each task runs in a separate Node process. This means that if you have a long-running task, it will not block other tasks from running. -## Options +## Arguments + +``` +npx trigger.dev@latest dev [path] +``` - - The name of the config file, found at [path]. - + - - The project ref. Required if there is no config file. - +## Options - - Pass a custom path to an env file. We automatically detect `.env`, `.env.local`, - `.env.development`, and `.env.development.local` files. - + - - Skip checking for `@trigger.dev` package updates. - + - - The login profile to use. Defaults to `default`. - + - - Override the API URL. Defaults to `https://api.trigger.dev`. - + - - The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This - does not affect the log level of your trigger.dev tasks. Defaults to `log`. - +### Common options -## Standard options +These options are available on most commands. - - Shows the help information for the command. - + ## Concurrently running the terminal diff --git a/docs/snippets/cli-options-common.mdx b/docs/snippets/cli-options-common.mdx new file mode 100644 index 0000000000..935b613966 --- /dev/null +++ b/docs/snippets/cli-options-common.mdx @@ -0,0 +1,20 @@ +import LogLevelOption from "/snippets/cli-options-log-level.mdx"; +import SkipTelemetryOption from "/snippets/cli-options-skip-telemetry.mdx"; +import HelpOption from "/snippets/cli-options-help.mdx"; +import VersionOption from "/snippets/cli-options-version.mdx"; + + + The login profile to use. Defaults to "default". + + + + Override the default API URL. If not specified, it uses `https://api.trigger.dev`. This can also be set via the `TRIGGER_API_URL` environment variable. + + + + + + + + + \ No newline at end of file diff --git a/docs/snippets/cli-options-config-file.mdx b/docs/snippets/cli-options-config-file.mdx new file mode 100644 index 0000000000..36cebd9d3b --- /dev/null +++ b/docs/snippets/cli-options-config-file.mdx @@ -0,0 +1,3 @@ + + The name of the config file found at the project path. Defaults to `trigger.config.ts` + \ No newline at end of file diff --git a/docs/snippets/cli-options-env-file.mdx b/docs/snippets/cli-options-env-file.mdx new file mode 100644 index 0000000000..1494c17f8b --- /dev/null +++ b/docs/snippets/cli-options-env-file.mdx @@ -0,0 +1,4 @@ + + Load environment variables from a file. This will only hydrate the `process.env` of the CLI + process, not the tasks. + \ No newline at end of file diff --git a/docs/snippets/cli-options-help.mdx b/docs/snippets/cli-options-help.mdx new file mode 100644 index 0000000000..47451d9467 --- /dev/null +++ b/docs/snippets/cli-options-help.mdx @@ -0,0 +1,3 @@ + + Shows the help information for the command. + \ No newline at end of file diff --git a/docs/snippets/cli-options-log-level.mdx b/docs/snippets/cli-options-log-level.mdx new file mode 100644 index 0000000000..c16bbaee15 --- /dev/null +++ b/docs/snippets/cli-options-log-level.mdx @@ -0,0 +1,3 @@ + + The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This does not affect the log level of your trigger.dev tasks. Defaults to `log`. + \ No newline at end of file diff --git a/docs/snippets/cli-options-project-ref.mdx b/docs/snippets/cli-options-project-ref.mdx new file mode 100644 index 0000000000..efa7c46f6c --- /dev/null +++ b/docs/snippets/cli-options-project-ref.mdx @@ -0,0 +1,3 @@ + + The project ref. Required if there is no config file. + \ No newline at end of file diff --git a/docs/snippets/cli-options-skip-telemetry.mdx b/docs/snippets/cli-options-skip-telemetry.mdx new file mode 100644 index 0000000000..6823b00b82 --- /dev/null +++ b/docs/snippets/cli-options-skip-telemetry.mdx @@ -0,0 +1,3 @@ + + Opt-out of sending telemetry data. This can also be done via the `TRIGGER_TELEMETRY_DISABLED` environment variable. Just set it to anything other than an empty string. + \ No newline at end of file diff --git a/docs/snippets/cli-options-skip-update-check.mdx b/docs/snippets/cli-options-skip-update-check.mdx new file mode 100644 index 0000000000..f09865cd43 --- /dev/null +++ b/docs/snippets/cli-options-skip-update-check.mdx @@ -0,0 +1,3 @@ + + Skip checking for `@trigger.dev` package updates. + \ No newline at end of file diff --git a/docs/snippets/cli-options-version.mdx b/docs/snippets/cli-options-version.mdx new file mode 100644 index 0000000000..0b1ec6990c --- /dev/null +++ b/docs/snippets/cli-options-version.mdx @@ -0,0 +1,3 @@ + + Displays the version number of the CLI. + \ No newline at end of file diff --git a/docs/troubleshooting.mdx b/docs/troubleshooting.mdx index 4802a68b43..11aa4a6d6a 100644 --- a/docs/troubleshooting.mdx +++ b/docs/troubleshooting.mdx @@ -13,19 +13,19 @@ import RateLimitHitUseBatchTrigger from "/snippets/rate-limit-hit-use-batchtrigg If you see this error: -```ts +``` 6090 verbose stack Error: EACCES: permission denied, rename '/Users/user/.npm/_cacache/tmp/f1bfea11' -> '/Users/user/.npm/_cacache/content-v2/sha512/31/d8/e094a47a0105d06fd246892ed1736c02eae323726ec6a3f34734eeb71308895dfba4f4f82a88ffe7e480c90b388c91fc3d9f851ba7b96db4dc33fbc65528' ``` First, clear the npm cache: -```ts +```sh npm cache clean --force ``` Then change the permissions of the npm folder (if 1 doesn't work): -```ts +```sh sudo chown -R $(whoami) ~/.npm ``` @@ -78,7 +78,7 @@ Your code is deployed separately from the rest of your app(s) so you need to mak ### `Error: @prisma/client did not initialize yet.` -Prisma uses code generation to create the client from your schema file. This means you need to add a bit of config so we can generate this file before your tasks run: [read the guide](/config/config-file#prisma). +Prisma uses code generation to create the client from your schema file. This means you need to add a bit of config so we can generate this file before your tasks run: [Read the guide](/config/config-file#prisma). ### When triggering subtasks the parent task finishes too soon @@ -90,6 +90,10 @@ Make sure that you always use `await` when you call `trigger`, `triggerAndWait`, View the [rate limits](/limits) page for more information. +### `Crypto is not defined` + +This can happen in different situations, for example when using plain strings as idempotency keys. Support for `Crypto` without a special flag was added in Node `v19.0.0`. You will have to upgrade Node - we recommend even-numbered major releases, e.g. `v20` or `v22`. Alternatively, you can switch from plain strings to the `idempotencyKeys.create` SDK function. [Read the guide](/idempotency). + ## Framework specific issues ### NestJS swallows all errors/exceptions @@ -115,7 +119,7 @@ NestJS has a global exception filter that catches all errors and swallows them, If you see this error: -```ts +``` Worker failed to start ReferenceError: React is not defined ```