@ai-sdk/provider-utils 5.0.43 → 5.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider-utils",
3
- "version": "5.0.43",
3
+ "version": "5.0.44",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -134,13 +134,16 @@ export async function getDefaultDownloadFetch(): Promise<FetchFunction> {
134
134
  }
135
135
 
136
136
  function createSafeNodeFetch(): FetchFunction {
137
- // Load Node-only modules indirectly so browser bundlers do not pull undici
138
- // and Node built-ins into the browser-facing provider-utils entry point.
139
- const { createRequire } = loadBuiltinModule<NodeModule>('node:module');
137
+ // @vercel/nft (node file trace) only recognizes an indirectly loaded createRequire when its receiver
138
+ // is named `module` and the returned require function is assigned.
139
+ // eslint-disable-next-line @next/next/no-assign-module-variable
140
+ const module = loadBuiltinModule<NodeModule>('node:module');
140
141
  const { lookup } = loadBuiltinModule<NodeDns>('node:dns');
141
- const { Agent, fetch } = createRequire(getCurrentModulePath())(
142
- 'undici',
143
- ) as Undici;
142
+
143
+ // Assign the created require function so deployment tracers can recognize
144
+ // the static dependency without bundlers inlining undici.
145
+ const nodeRequire = module.createRequire(getCurrentModulePath());
146
+ const { Agent, fetch } = nodeRequire('undici') as Undici;
144
147
 
145
148
  const dispatcher = new Agent({
146
149
  connect: {