JS monorepo deployment with Turborepo

Hi, I’m trying to set up a monorepo with Turborepo deployment with Fly.io and run into some problems.

I looked into Fly.io doc on monorepo but not sure how it would work since I need to build all the dependencies during build.

The turborepo I’m trying out is the kitchen sink example here: turborepo/examples/kitchen-sink at main · vercel/turborepo · GitHub. I’m mainly interested in the Remix deployment right now, but Next.js and maybe a NodeJS BE in the future.

Would appreciate any help or pointer to see how I can get this to work. Thanks!

Hi Alex,

Going a bit outside my comfort zone here… please see if the below is helpful.

In the Fly monorepo link you’ve shared, there’s a link to doing multi-stage builds.

On to Remix, you could look at these for reference:
https://fly.io/docs/getting-started/remix/
https://github.com/fly-apps/hello-remix
https://remix.run/docs/en/v1/tutorials/jokes

Hope this helps!

I’m having issues as well, it seems that any module imported into my remix app from my packages are not bundled. Here is my remix.config.js below, for example getting error when importing anything from “web-ui” or “api” , am I missing something?

/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
  ignoredRouteFiles: ["**/.*"],
  // appDirectory: "app",
  // assetsBuildDirectory: "public/build",
  // serverBuildPath: "build/index.js",
  // publicPath: "/build/",
  tailwind: true,
  postcss: true,
  serverModuleFormat: "cjs",
  watchPaths: [
    "./tailwind.config.ts",
    "../../packages/testing",
    "../../packages/tailwind-config",
    "../../packages/web-ui",
    "../../packages/utils",
    "../../packages/shared-ui",
    "../../packages/types",
    "../../packages/api",
  ],
  serverDependenciesToBundle: [
    "api",
    "web-ui",
    "tailwind-config",
    "testing",
    "utils",
    "shared-ui",
    "types",
    "axios",
  ],
  future: {
    v2_dev: true,
    v2_errorBoundary: true,
    v2_headers: true,
    v2_meta: true,
    v2_normalizeFormMethod: true,
    v2_routeConvention: true,
  },
};