rhys1790
rhys17903mo ago

Netlify Deployment Build Failures

Hi folks, having some issues with my build of convex generated files when deploying to netlify: logs:
6:08:25 PM: Type error: Cannot find module '../../rugby321/convex/_generated/server' or its corresponding type declarations.
6:08:25 PM: 3 | internalAction,
6:08:25 PM: 4 | internalMutation,
6:08:25 PM: > 5 | } from "../../rugby321/convex/_generated/server";
6:08:25 PM: | ^
6:08:25 PM: 6 | import { v } from "convex/values";
6:08:25 PM: 7 | import { fetch } from "cross-fetch";
6:08:25 PM: 8 | import * as cheerio from "cheerio";
6:08:25 PM: Next.js build worker exited with code: 1 and signal: null
6:08:25 PM: ✖ 'npm run build' failed
6:08:25 PM: ​
6:08:25 PM: "build.command" failed
6:08:25 PM: ────────────────────────────────────────────────────────────────
6:08:25 PM: ​
6:08:25 PM: Error message
6:08:25 PM: Command failed with exit code 1: npx convex deploy --cmd 'npm run build' (https://ntl.fyi/exit-code-1)
6:08:25 PM: Type error: Cannot find module '../../rugby321/convex/_generated/server' or its corresponding type declarations.
6:08:25 PM: 3 | internalAction,
6:08:25 PM: 4 | internalMutation,
6:08:25 PM: > 5 | } from "../../rugby321/convex/_generated/server";
6:08:25 PM: | ^
6:08:25 PM: 6 | import { v } from "convex/values";
6:08:25 PM: 7 | import { fetch } from "cross-fetch";
6:08:25 PM: 8 | import * as cheerio from "cheerio";
6:08:25 PM: Next.js build worker exited with code: 1 and signal: null
6:08:25 PM: ✖ 'npm run build' failed
6:08:25 PM: ​
6:08:25 PM: "build.command" failed
6:08:25 PM: ────────────────────────────────────────────────────────────────
6:08:25 PM: ​
6:08:25 PM: Error message
6:08:25 PM: Command failed with exit code 1: npx convex deploy --cmd 'npm run build' (https://ntl.fyi/exit-code-1)
I am tried a number of different build commands with no success. Have also checked that the generated files have been commited into git.
3 Replies
Convex Bot
Convex Bot3mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart3mo ago
Netlify's build system can't read above the base directory, guessing this is a monorepo where you've set the base to a specific package in the repo and convex is outside of the base.
erquhart
erquhart3mo ago
Actually it looks like you need to make sure your "package directory" is your site root where your site package.json is, and your "base directory" is the repo root, that way you can import from anywhere in the repo: https://docs.netlify.com/configure-builds/monorepos/#set-the-package-directory
Monorepos
Set up your sites to build from a monorepo. Consider where to declare dependencies and how to use workspaces on the platform.

Did you find this page helpful?