You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/aws/common_issues.mdx
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,3 +112,59 @@ This error is usually resolved by removing all yarn files in your repo. You shou
112
112
If you use `yarn` there is a workaround [here](https://stackoverflow.com/a/76902985).
113
113
114
114
If you are not using `yarn` and you see `yarn` related errors it might be solved by running `corepack disable` or updating `nvm` to `0.40.2`.
115
+
116
+
#### A file/dependency is missing from my bundle
117
+
118
+
Sometimes there might be a file missing from your server functions bundle. An example could be `sentry.server.config.ts`. It can be any file or directory and it also accept globs. In Next there is an option to include files that were not picked up by tracing.
119
+
Its called `outputFileTracingIncludes`. Here is an example on how to use it in `next.config.ts`:
120
+
121
+
```ts
122
+
importtype { NextConfig } from"next";
123
+
124
+
const nextConfig:NextConfig= {
125
+
/* config options here */
126
+
outputFileTracingIncludes: {
127
+
"*": ["sentry.server.config.ts"],
128
+
// can also be a glob pattern
129
+
"/api/*": ["node_modules/.prisma/client/**/*"],
130
+
},
131
+
};
132
+
133
+
exportdefaultnextConfig;
134
+
```
135
+
136
+
This will copy the file to `.open-next/server-functions/default/sentry.server.config.ts`, or every splitted function in this case.
137
+
To read more about `outputFileTracingIncludes` you can refer to the [Next.js documentation](https://nextjs.org/docs/pages/api-reference/config/next-config-js/output#caveats).
138
+
139
+
It works with function splitting in OpenNext aswell. If your key corresponds to a specific route (i.e: `api/test`), it will be included only in the function bundle for that route.
140
+
Using `*` as a key, however, will include it in every function bundle. Here is an example with function splitting:
It will also work in a monorepo. Lets say you have your Next app in `packages/web`, the files will be written to: `packages/web/.open-next/server-functions/default/packages/web/*`
0 commit comments