Github integration for Pages apps in monorepo

I had mixed success this weekend attempting to use the Github integration in a monorepo with some Pages apps. The main reason I'm doing this is to get the UI for branch controls . I don't want to control Production/Preview rules with an API request. I started out trying to add the Pages project by pointing to the directory where it was located. That found the wrangler.toml but failed running the build command (seemingly because remix wasn't in the path I also tried from the monorepo root and that failed to find the wrangler.toml (expected. there isn't one in the root) but the build command (scoped to the app directory) did work. I'd like to run/specify things relative to the app directory, but am not sure what the issue is or how to debug/fix it. Here are some lightly redacted/edited logs:
## From app directory
### Settings
build command: npm run build
build output directory: build/client
root directory: apps/pages-remix-a

### Logs
Using v2 root directory strategy
Checking for configuration in a wrangler.toml configuration file (BETA)
Found wrangler.toml file. Reading build configuration...
pages_build_output_dir: build/client
Successfully read wrangler.toml file.
Executing user command: npm run build

> build
> remix vite:build

sh: 1: remix: not found
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: lift-practice
npm ERR! at location: /opt/buildhome/repo/apps/lift-practice
## From app directory
### Settings
build command: npm run build
build output directory: build/client
root directory: apps/pages-remix-a

### Logs
Using v2 root directory strategy
Checking for configuration in a wrangler.toml configuration file (BETA)
Found wrangler.toml file. Reading build configuration...
pages_build_output_dir: build/client
Successfully read wrangler.toml file.
Executing user command: npm run build

> build
> remix vite:build

sh: 1: remix: not found
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: lift-practice
npm ERR! at location: /opt/buildhome/repo/apps/lift-practice
## From monorepo root
### Settings
build command: npm run build -w apps/pages-remix-a
build output directory: apps/pages-remix-a/build/client
root directory: (empty)

### Logs
Using v2 root directory strategy
Checking for configuration in a wrangler.toml configuration file (BETA)
No wrangler.toml file found. Continuing.
Executing user command: npm run build -w apps/pages-remix-a

> build
> remix vite:build
Finished
Found _worker.js in output directory. Uploading.
✨ Compiled Worker successfully
## From monorepo root
### Settings
build command: npm run build -w apps/pages-remix-a
build output directory: apps/pages-remix-a/build/client
root directory: (empty)

### Logs
Using v2 root directory strategy
Checking for configuration in a wrangler.toml configuration file (BETA)
No wrangler.toml file found. Continuing.
Executing user command: npm run build -w apps/pages-remix-a

> build
> remix vite:build
Finished
Found _worker.js in output directory. Uploading.
✨ Compiled Worker successfully
1 Reply
JFSIII
JFSIIIOP7mo ago
I'm still struggling with this. I tried converting the "build" script from "remix vite:dev" to "npx remix vite dev" but that also failed (with "unable to determine executable to run", IIRC) I also tried adding the SKIP_DEPENDENCY_INSTALL variable but I can't add from the dashboard b/c using wrangler.toml. I added it to my wrangler.toml but I don't see it listed in the variables and the install behavior didn't change
Want results from more Discord servers?
Add your server