chore(docs): Add playwright workaround (#2973)
Adds a workaround to playwright to browser download failures based on this GH issue: https://github.com/triggerdotdev/trigger.dev/issues/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 -->
This commit is contained in:
@@ -91,6 +91,32 @@ The extension sets the following environment variables during the build:
|
||||
- `PLAYWRIGHT_SKIP_BROWSER_VALIDATION`: Set to `1` to skip browser validation at runtime
|
||||
- `DISPLAY`: Set to `:99` if `headless: false` (for Xvfb)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Browser download failures
|
||||
|
||||
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.
|
||||
|
||||
**Workaround:** Revert Playwright to version `1.40.0` in your project dependencies. You can specify this version explicitly in your config:
|
||||
|
||||
```ts
|
||||
import { defineConfig } from "@trigger.dev/sdk";
|
||||
import { playwright } from "@trigger.dev/build/extensions/playwright";
|
||||
|
||||
export default defineConfig({
|
||||
project: "<project ref>",
|
||||
build: {
|
||||
extensions: [
|
||||
playwright({
|
||||
version: "1.40.0",
|
||||
}),
|
||||
],
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
For more details, see [GitHub issue #2440](https://github.com/triggerdotdev/trigger.dev/issues/2440#issuecomment-3815104376).
|
||||
|
||||
## Managing browser instances
|
||||
|
||||
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.
|
||||
|
||||
@@ -276,6 +276,14 @@
|
||||
"management/envvars/update",
|
||||
"management/envvars/delete"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Deployments API",
|
||||
"pages": [
|
||||
"management/deployments/retrieve",
|
||||
"management/deployments/get-latest",
|
||||
"management/deployments/promote"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Get latest deployment"
|
||||
openapi: "v3-openapi GET /api/v1/deployments/latest"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Promote deployment"
|
||||
openapi: "v3-openapi POST /api/v1/deployments/{version}/promote"
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Get deployment"
|
||||
openapi: "v3-openapi GET /api/v1/deployments/{deploymentId}"
|
||||
---
|
||||
@@ -505,6 +505,234 @@ paths:
|
||||
|
||||
await runs.cancel("run_1234");
|
||||
|
||||
"/api/v1/deployments/{deploymentId}":
|
||||
parameters:
|
||||
- in: path
|
||||
name: deploymentId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The deployment ID.
|
||||
get:
|
||||
operationId: get_deployment_v1
|
||||
summary: Get deployment
|
||||
description: Retrieve information about a specific deployment by its ID.
|
||||
responses:
|
||||
"200":
|
||||
description: Successful request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The deployment ID
|
||||
status:
|
||||
type: string
|
||||
enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"]
|
||||
description: The current status of the deployment
|
||||
contentHash:
|
||||
type: string
|
||||
description: Hash of the deployment content
|
||||
shortCode:
|
||||
type: string
|
||||
description: The short code for the deployment
|
||||
version:
|
||||
type: string
|
||||
description: The deployment version (e.g., "20250228.1")
|
||||
imageReference:
|
||||
type: string
|
||||
nullable: true
|
||||
description: Reference to the deployment image
|
||||
imagePlatform:
|
||||
type: string
|
||||
description: Platform of the deployment image
|
||||
externalBuildData:
|
||||
type: object
|
||||
nullable: true
|
||||
description: External build data if applicable
|
||||
errorData:
|
||||
type: object
|
||||
nullable: true
|
||||
description: Error data if the deployment failed
|
||||
worker:
|
||||
type: object
|
||||
nullable: true
|
||||
description: Worker information if available
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
version:
|
||||
type: string
|
||||
tasks:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
filePath:
|
||||
type: string
|
||||
exportName:
|
||||
type: string
|
||||
"401":
|
||||
description: Unauthorized - Access token is missing or invalid
|
||||
"404":
|
||||
description: Deployment not found
|
||||
tags:
|
||||
- deployments
|
||||
security:
|
||||
- secretKey: []
|
||||
x-codeSamples:
|
||||
- lang: typescript
|
||||
source: |-
|
||||
const response = await fetch(
|
||||
`https://api.trigger.dev/api/v1/deployments/${deploymentId}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${secretKey}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
const deployment = await response.json();
|
||||
- lang: curl
|
||||
source: |-
|
||||
curl -X GET "https://api.trigger.dev/api/v1/deployments/deployment_1234" \
|
||||
-H "Authorization: Bearer tr_dev_1234"
|
||||
|
||||
"/api/v1/deployments/latest":
|
||||
get:
|
||||
operationId: get_latest_deployment_v1
|
||||
summary: Get latest deployment
|
||||
description: Retrieve information about the latest unmanaged deployment for the authenticated project.
|
||||
responses:
|
||||
"200":
|
||||
description: Successful request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The deployment ID
|
||||
status:
|
||||
type: string
|
||||
enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"]
|
||||
description: The current status of the deployment
|
||||
contentHash:
|
||||
type: string
|
||||
description: Hash of the deployment content
|
||||
shortCode:
|
||||
type: string
|
||||
description: The short code for the deployment
|
||||
version:
|
||||
type: string
|
||||
description: The deployment version (e.g., "20250228.1")
|
||||
imageReference:
|
||||
type: string
|
||||
nullable: true
|
||||
description: Reference to the deployment image
|
||||
errorData:
|
||||
type: object
|
||||
nullable: true
|
||||
description: Error data if the deployment failed
|
||||
"401":
|
||||
description: Unauthorized - API key is missing or invalid
|
||||
"404":
|
||||
description: No deployment found
|
||||
tags:
|
||||
- deployments
|
||||
security:
|
||||
- secretKey: []
|
||||
x-codeSamples:
|
||||
- lang: typescript
|
||||
source: |-
|
||||
const response = await fetch(
|
||||
"https://api.trigger.dev/api/v1/deployments/latest",
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${secretKey}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
const deployment = await response.json();
|
||||
- lang: curl
|
||||
source: |-
|
||||
curl -X GET "https://api.trigger.dev/api/v1/deployments/latest" \
|
||||
-H "Authorization: Bearer tr_dev_1234"
|
||||
|
||||
"/api/v1/deployments/{version}/promote":
|
||||
parameters:
|
||||
- in: path
|
||||
name: version
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The deployment version to promote (e.g., "20250228.1").
|
||||
post:
|
||||
operationId: promote_deployment_v1
|
||||
summary: Promote deployment
|
||||
description: Promote a previously deployed version to be the current version for the environment. This makes the specified version active for new task runs.
|
||||
responses:
|
||||
"200":
|
||||
description: Deployment promoted successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: The deployment ID
|
||||
version:
|
||||
type: string
|
||||
description: The deployment version (e.g., "20250228.1")
|
||||
shortCode:
|
||||
type: string
|
||||
description: The short code for the deployment
|
||||
"400":
|
||||
description: Invalid request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
"401":
|
||||
description: Unauthorized - API key is missing or invalid
|
||||
"404":
|
||||
description: Deployment not found
|
||||
tags:
|
||||
- deployments
|
||||
security:
|
||||
- secretKey: []
|
||||
x-codeSamples:
|
||||
- lang: typescript
|
||||
source: |-
|
||||
const response = await fetch(
|
||||
`https://api.trigger.dev/api/v1/deployments/${version}/promote`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Authorization": `Bearer ${secretKey}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
const result = await response.json();
|
||||
- lang: curl
|
||||
source: |-
|
||||
curl -X POST "https://api.trigger.dev/api/v1/deployments/20250228.1/promote" \
|
||||
-H "Authorization: Bearer tr_dev_1234" \
|
||||
-H "Content-Type: application/json"
|
||||
|
||||
"/api/v1/runs/{runId}/reschedule":
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/runId"
|
||||
|
||||
Reference in New Issue
Block a user