Skip to content

Commit 01208fd

Browse files
authored
chore(docs): Add playwright workaround (#2973)
Adds a workaround to playwright to browser download failures based on this GH issue: #2440 <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/2973"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
1 parent 5e049cd commit 01208fd

File tree

6 files changed

+274
-0
lines changed

6 files changed

+274
-0
lines changed

docs/config/extensions/playwright.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,32 @@ The extension sets the following environment variables during the build:
9191
- `PLAYWRIGHT_SKIP_BROWSER_VALIDATION`: Set to `1` to skip browser validation at runtime
9292
- `DISPLAY`: Set to `:99` if `headless: false` (for Xvfb)
9393

94+
## Troubleshooting
95+
96+
### Browser download failures
97+
98+
If you encounter errors during the build process related to browser downloads (e.g., "failed to solve: process did not complete successfully: exit code: 9"), this is a known issue with certain Playwright versions.
99+
100+
**Workaround:** Revert Playwright to version `1.40.0` in your project dependencies. You can specify this version explicitly in your config:
101+
102+
```ts
103+
import { defineConfig } from "@trigger.dev/sdk";
104+
import { playwright } from "@trigger.dev/build/extensions/playwright";
105+
106+
export default defineConfig({
107+
project: "<project ref>",
108+
build: {
109+
extensions: [
110+
playwright({
111+
version: "1.40.0",
112+
}),
113+
],
114+
},
115+
});
116+
```
117+
118+
For more details, see [GitHub issue #2440](https://github.com/triggerdotdev/trigger.dev/issues/2440#issuecomment-3815104376).
119+
94120
## Managing browser instances
95121

96122
To prevent issues with waits and resumes, you can use middleware and locals to manage the browser instance. This will ensure the browser is available for the whole run, and is properly cleaned up on waits, resumes, and after the run completes.

docs/docs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,14 @@
276276
"management/envvars/update",
277277
"management/envvars/delete"
278278
]
279+
},
280+
{
281+
"group": "Deployments API",
282+
"pages": [
283+
"management/deployments/retrieve",
284+
"management/deployments/get-latest",
285+
"management/deployments/promote"
286+
]
279287
}
280288
]
281289
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Get latest deployment"
3+
openapi: "v3-openapi GET /api/v1/deployments/latest"
4+
---
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Promote deployment"
3+
openapi: "v3-openapi POST /api/v1/deployments/{version}/promote"
4+
---
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "Get deployment"
3+
openapi: "v3-openapi GET /api/v1/deployments/{deploymentId}"
4+
---

docs/v3-openapi.yaml

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,234 @@ paths:
505505
506506
await runs.cancel("run_1234");
507507
508+
"/api/v1/deployments/{deploymentId}":
509+
parameters:
510+
- in: path
511+
name: deploymentId
512+
required: true
513+
schema:
514+
type: string
515+
description: The deployment ID.
516+
get:
517+
operationId: get_deployment_v1
518+
summary: Get deployment
519+
description: Retrieve information about a specific deployment by its ID.
520+
responses:
521+
"200":
522+
description: Successful request
523+
content:
524+
application/json:
525+
schema:
526+
type: object
527+
properties:
528+
id:
529+
type: string
530+
description: The deployment ID
531+
status:
532+
type: string
533+
enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"]
534+
description: The current status of the deployment
535+
contentHash:
536+
type: string
537+
description: Hash of the deployment content
538+
shortCode:
539+
type: string
540+
description: The short code for the deployment
541+
version:
542+
type: string
543+
description: The deployment version (e.g., "20250228.1")
544+
imageReference:
545+
type: string
546+
nullable: true
547+
description: Reference to the deployment image
548+
imagePlatform:
549+
type: string
550+
description: Platform of the deployment image
551+
externalBuildData:
552+
type: object
553+
nullable: true
554+
description: External build data if applicable
555+
errorData:
556+
type: object
557+
nullable: true
558+
description: Error data if the deployment failed
559+
worker:
560+
type: object
561+
nullable: true
562+
description: Worker information if available
563+
properties:
564+
id:
565+
type: string
566+
version:
567+
type: string
568+
tasks:
569+
type: array
570+
items:
571+
type: object
572+
properties:
573+
id:
574+
type: string
575+
slug:
576+
type: string
577+
filePath:
578+
type: string
579+
exportName:
580+
type: string
581+
"401":
582+
description: Unauthorized - Access token is missing or invalid
583+
"404":
584+
description: Deployment not found
585+
tags:
586+
- deployments
587+
security:
588+
- secretKey: []
589+
x-codeSamples:
590+
- lang: typescript
591+
source: |-
592+
const response = await fetch(
593+
`https://api.trigger.dev/api/v1/deployments/${deploymentId}`,
594+
{
595+
method: "GET",
596+
headers: {
597+
"Authorization": `Bearer ${secretKey}`,
598+
},
599+
}
600+
);
601+
const deployment = await response.json();
602+
- lang: curl
603+
source: |-
604+
curl -X GET "https://api.trigger.dev/api/v1/deployments/deployment_1234" \
605+
-H "Authorization: Bearer tr_dev_1234"
606+
607+
"/api/v1/deployments/latest":
608+
get:
609+
operationId: get_latest_deployment_v1
610+
summary: Get latest deployment
611+
description: Retrieve information about the latest unmanaged deployment for the authenticated project.
612+
responses:
613+
"200":
614+
description: Successful request
615+
content:
616+
application/json:
617+
schema:
618+
type: object
619+
properties:
620+
id:
621+
type: string
622+
description: The deployment ID
623+
status:
624+
type: string
625+
enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"]
626+
description: The current status of the deployment
627+
contentHash:
628+
type: string
629+
description: Hash of the deployment content
630+
shortCode:
631+
type: string
632+
description: The short code for the deployment
633+
version:
634+
type: string
635+
description: The deployment version (e.g., "20250228.1")
636+
imageReference:
637+
type: string
638+
nullable: true
639+
description: Reference to the deployment image
640+
errorData:
641+
type: object
642+
nullable: true
643+
description: Error data if the deployment failed
644+
"401":
645+
description: Unauthorized - API key is missing or invalid
646+
"404":
647+
description: No deployment found
648+
tags:
649+
- deployments
650+
security:
651+
- secretKey: []
652+
x-codeSamples:
653+
- lang: typescript
654+
source: |-
655+
const response = await fetch(
656+
"https://api.trigger.dev/api/v1/deployments/latest",
657+
{
658+
method: "GET",
659+
headers: {
660+
"Authorization": `Bearer ${secretKey}`,
661+
},
662+
}
663+
);
664+
const deployment = await response.json();
665+
- lang: curl
666+
source: |-
667+
curl -X GET "https://api.trigger.dev/api/v1/deployments/latest" \
668+
-H "Authorization: Bearer tr_dev_1234"
669+
670+
"/api/v1/deployments/{version}/promote":
671+
parameters:
672+
- in: path
673+
name: version
674+
required: true
675+
schema:
676+
type: string
677+
description: The deployment version to promote (e.g., "20250228.1").
678+
post:
679+
operationId: promote_deployment_v1
680+
summary: Promote deployment
681+
description: Promote a previously deployed version to be the current version for the environment. This makes the specified version active for new task runs.
682+
responses:
683+
"200":
684+
description: Deployment promoted successfully
685+
content:
686+
application/json:
687+
schema:
688+
type: object
689+
properties:
690+
id:
691+
type: string
692+
description: The deployment ID
693+
version:
694+
type: string
695+
description: The deployment version (e.g., "20250228.1")
696+
shortCode:
697+
type: string
698+
description: The short code for the deployment
699+
"400":
700+
description: Invalid request
701+
content:
702+
application/json:
703+
schema:
704+
type: object
705+
properties:
706+
error:
707+
type: string
708+
"401":
709+
description: Unauthorized - API key is missing or invalid
710+
"404":
711+
description: Deployment not found
712+
tags:
713+
- deployments
714+
security:
715+
- secretKey: []
716+
x-codeSamples:
717+
- lang: typescript
718+
source: |-
719+
const response = await fetch(
720+
`https://api.trigger.dev/api/v1/deployments/${version}/promote`,
721+
{
722+
method: "POST",
723+
headers: {
724+
"Authorization": `Bearer ${secretKey}`,
725+
"Content-Type": "application/json",
726+
},
727+
}
728+
);
729+
const result = await response.json();
730+
- lang: curl
731+
source: |-
732+
curl -X POST "https://api.trigger.dev/api/v1/deployments/20250228.1/promote" \
733+
-H "Authorization: Bearer tr_dev_1234" \
734+
-H "Content-Type: application/json"
735+
508736
"/api/v1/runs/{runId}/reschedule":
509737
parameters:
510738
- $ref: "#/components/parameters/runId"

0 commit comments

Comments
 (0)