Skip to content

v3: fix additionalFiles, uncaught exceptions, and improve errors #1048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/angry-eagles-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"trigger.dev": patch
"@trigger.dev/core": patch
---

- Fix additionalFiles that aren't decendants
- Stop swallowing uncaught exceptions in prod
- Improve warnings and errors, fail early on critical warnings
- New arg to --save-logs even for successful builds
22 changes: 20 additions & 2 deletions docs/v3/trigger-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const config: TriggerConfig = {

## ESM-only packages

We'll let you know when run the CLI dev command if this is a problem. Some packages are ESM-only so they don't work directly from CJS when using Node.js. In that case you need to add them to the `dependenciesToBundle` array in your `trigger.config.ts` file.
We'll let you know when running the CLI dev command if this is a problem. Some packages are ESM-only so they don't work directly from CJS when using Node.js. In that case you need to add them to the `dependenciesToBundle` array in your `trigger.config.ts` file.

```ts trigger.config.ts
import type { TriggerConfig } from "@trigger.dev/sdk/v3";
Expand Down Expand Up @@ -92,14 +92,27 @@ Prisma works by generating a client from your `prisma.schema` file. This means y

<Step title="package.json postinstall `prisma generate`">

```json

<CodeGroup>

```json default path
{
"scripts": {
"postinstall": "prisma generate"
}
}
```

```json custom path
{
"scripts": {
"postinstall": "prisma generate --schema=./custom/path/to/schema.prisma"
}
}
```

</CodeGroup>

Anything you put in `postinstall` will be run as part of the install step. This is how Next.js recommends you set up Prisma anyway.

</Step>
Expand All @@ -111,7 +124,12 @@ Prisma works by generating a client from your `prisma.schema` file. This means y

export const config: TriggerConfig = {
//..other stuff

// using the default path
additionalFiles: ["./prisma/schema.prisma"],
// or a custom path, for example in a monorepo
additionalFiles: ["../../custom/path/to/schema.prisma"],

additionalPackages: ["[email protected]"],
};
```
Expand Down
Loading