Skip to content

Commit d947599

Browse files
thomasballingerConvex, Inc.
authored and
Convex, Inc.
committed
Improve CLI error for Node.js apis (#37297)
GitOrigin-RevId: 3d9bf566fa0140a1a5ae94c155419e75d0d18c9f
1 parent b0158ef commit d947599

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

npm-packages/convex/src/bundler/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ async function doEsbuild(
156156
// We don't print any error because esbuild already printed
157157
// all the relevant information.
158158
printedMessage: recommendUseNode
159-
? `It looks like you are using Node APIs from a file without the "use node" directive.\n` +
160-
`See https://docs.convex.dev/functions/runtimes#nodejs-runtime`
159+
? `\nIt looks like you are using Node APIs from a file without the "use node" directive.\n` +
160+
`Split out actions using Node.js APIs like this into a new file only containing actions that uses "use node" ` +
161+
`so these actions will run in a Node.js environment.\n` +
162+
`For more information see https://docs.convex.dev/functions/runtimes#nodejs-runtime\n`
161163
: null,
162164
});
163165
}

0 commit comments

Comments
 (0)