Skip to content

Commit 7fdb2c4

Browse files
authored
docs: troubleshooting and additional packages version pinning (#3092)
- Connection error troubleshooting - Additional packages version pinning - Realtime stream error troubleshooting
1 parent f0f4527 commit 7fdb2c4

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

docs/config/extensions/additionalPackages.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,25 @@ export default defineConfig({
1414
project: "<project ref>",
1515
// Your other config settings...
1616
build: {
17+
// Omit version for auto-resolution; for reproducible builds use e.g. packages: ["wrangler@X.Y.Z"]
1718
extensions: [additionalPackages({ packages: ["wrangler"] })],
1819
},
1920
});
2021
```
2122

22-
This allows you to include additional packages in the build that are not automatically included via imports. This is useful if you want to install a package that includes a CLI tool that you want to invoke in your tasks via `exec`. We will try to automatically resolve the version of the package but you can specify the version by using the `@` symbol:
23+
This allows you to include additional packages in the build that are not automatically included via imports. This is useful if you want to install a package that includes a CLI tool you can invoke in your tasks via `exec`. We will try to automatically resolve the version of the package but you can specify the version by using the `@` symbol.
24+
25+
If you omit the version, the build may use a cached or older resolution. For reproducible builds, pin the exact version (e.g. `wrangler@X.Y.Z`).
2326

2427
```ts
2528
import { defineConfig } from "@trigger.dev/sdk";
29+
import { additionalPackages } from "@trigger.dev/build/extensions/core";
2630

2731
export default defineConfig({
2832
project: "<project ref>",
2933
// Your other config settings...
3034
build: {
31-
extensions: [additionalPackages({ packages: ["wrangler@1.19.0"] })],
35+
extensions: [additionalPackages({ packages: ["wrangler@X.Y.Z"] })],
3236
},
3337
});
3438
```

docs/troubleshooting.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ The Yarn Plug'n'Play manifest forbids importing "@trigger.dev/core" here because
4545

4646
And you're using Yarn v1.22 or another package manager, check if you have a `.pnp.cjs` file in your home directory. This can happen if you previously had Yarn Plug'n'Play enabled globally. Remove the `.pnp.cjs` file to resolve the issue.
4747

48+
### `Connection error` when logging in
49+
50+
If you see "Connection error" when running `trigger login` (or "Failed to create authorization code"), try these in order:
51+
52+
1. **Clear saved auth and retry:** `npx trigger.dev@latest logout`, then `npx trigger.dev@latest login` again. Sometimes an invalid config is cached.
53+
2. **VPN or firewall:** Disconnect from VPN or check firewall/proxy; try `npx trigger.dev@latest login --log-level debug` for more detail.
54+
3. **TLS / certificate store:** Node may use a different CA store than your OS (e.g. `curl` works but the CLI fails). Try `export NODE_EXTRA_CA_CERTS=/etc/ssl/cert.pem` (macOS/Linux) then login again, or reinstall Node so it gets updated certs. Behind a corporate proxy or custom CA? Set `NODE_EXTRA_CA_CERTS` to that CA file.
55+
4856
## Deployment
4957

5058
Running the [trigger.dev deploy] command builds and deploys your code. Sometimes there can be issues building your code.
@@ -270,6 +278,23 @@ You could also offload the CPU-heavy work to a Node.js worker thread, but this i
270278

271279
If the above doesn't work, then we recommend you try increasing the machine size of your task. See our [machines guide](/machines) for more information.
272280

281+
### Realtime stream error (`sendBatchNonBlocking` / `S2AppendSession`)
282+
283+
Errors mentioning `sendBatchNonBlocking`, `@s2-dev/streamstore`, or `S2AppendSession` (often with `code: undefined`) can occur when you close a stream and then await `waitUntilComplete()`, or when a stream runs for a long time (e.g. 20+ minutes). Wrap `waitUntilComplete()` in try/catch so Transport/closed-stream errors don't fail your task:
284+
285+
```ts
286+
import { streams } from "@trigger.dev/sdk";
287+
288+
const { waitUntilComplete } = streams.pipe("my-stream", dataStream); // or streams.writer(...)
289+
try {
290+
await waitUntilComplete();
291+
} catch (err) {
292+
// Transport/closed-stream; log if needed or ignore
293+
}
294+
```
295+
296+
Alternatively, await `waitUntilComplete()` before closing the stream. See [Realtime Streams](/tasks/streams) for more.
297+
273298
## Framework specific issues
274299

275300
### NestJS swallows all errors/exceptions

0 commit comments

Comments
 (0)