# Another "Can't Deploy a New Remix App" post

**URL:** <https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587>\
**Category:** General\
**Created:** [April 1, 2022, 6:21am UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587 "2022-04-01T06:21:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chad](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/chad/32/48202_2.png) [@chad](https://community.fly.io/u/chad)\
**Post date:** [April 1, 2022, 6:21am UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/1 "2022-04-01T06:21:57Z")

</div>

Node: v16.14.2

Following

```auto
npx create-remix@latest

```

and choosing the blues stack.

Thanks.

The Error:

```auto
 start

2022-04-01T06:14:28.562 app[be322e4c] dfw [info] > cross-env NODE_ENV=production node ./build/server.js

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] /app/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:10

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] throw new Error(prefix);

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] ^

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] Error: Invariant failed

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at invariant (/app/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:10:15)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at getClient (/app/build/index.js:405:37)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Object. (/app/build/index.js:396:12)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Module._compile (node:internal/modules/cjs/loader:1103:14)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Module.load (node:internal/modules/cjs/loader:981:32)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Function.Module._load (node:internal/modules/cjs/loader:822:12)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Module.require (node:internal/modules/cjs/loader:1005:19)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at require (node:internal/modules/cjs/helpers:102:18)

2022-04-01T06:14:28.931 app[be322e4c] dfw [info] at Object. (/app/build/server.js:59:89) 

```

The toml file:

```auto
# fly.toml file generated for hovertrail on 2022-03-31T23:08:09-07:00

app = "hovertrail"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]
  PORT = "8080"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

```

Dockerfile:

```auto
# base node image
FROM node:16-bullseye-slim as base

# Install openssl for Prisma
RUN apt-get update && apt-get install -y openssl

# Install all node_modules, including dev dependencies
FROM base as deps

RUN mkdir /app
WORKDIR /app

ADD package.json package-lock.json ./
RUN npm install --production=false

# Setup production node_modules
FROM base as production-deps

RUN mkdir /app
WORKDIR /app

COPY --from=deps /app/node_modules /app/node_modules
ADD package.json package-lock.json ./
RUN npm prune --production

# Build the app
FROM base as build

ENV NODE_ENV=production

RUN mkdir /app
WORKDIR /app

COPY --from=deps /app/node_modules /app/node_modules

# If we're using Prisma, uncomment to cache the prisma schema
# ADD prisma .
# RUN npx prisma generate

ADD . .
RUN npm run build

# Finally, build the production image with minimal footprint
FROM base

ENV NODE_ENV=production

RUN mkdir /app
WORKDIR /app

COPY --from=production-deps /app/node_modules /app/node_modules

# Uncomment if using Prisma
# COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma

COPY --from=build /app/build /app/build
COPY --from=build /app/public /app/public
ADD . .

CMD ["npm", "run", "start"]

```

---

<div class="post-metadata">

**Author:** ![jsierles](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jsierles/32/595_2.png) [@jsierles](https://community.fly.io/u/jsierles)\
**Post date:** [April 1, 2022, 7:44am UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/2 "2022-04-01T07:44:24Z")

</div>

Did you set the `SESSION_SECRET` with `fly secrets set`?

---

<div class="post-metadata">

**Author:** ![chad](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/chad/32/48202_2.png) [@chad](https://community.fly.io/u/chad)\
**Post date:** [April 1, 2022, 2:07pm UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/3 "2022-04-01T14:07:40Z")

</div>

No, I followed this guide: [Deploy a Remix Application](https://fly.io/docs/getting-started/remix)

Is setting secrets something that should be added to that guide? Thanks!

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [April 1, 2022, 2:28pm UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/4 "2022-04-01T14:28:55Z")

</div>

The Remix Blues stack does require secrets. The stacks have their own guides: [GitHub - remix-run/blues-stack: The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.](https://github.com/remix-run/blues-stack#deployment)

---

<div class="post-metadata">

**Author:** ![chad](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/chad/32/48202_2.png) [@chad](https://community.fly.io/u/chad)\
**Post date:** [April 1, 2022, 2:36pm UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/5 "2022-04-01T14:36:19Z")

</div>

Ayup - I just greped for `fly secrets` in the codebase and stumbled across it.

We might want to drop a note on the guide to this effect - “Using one of the stack installers? Check out the README.md on the given stack”

Thanks! I’ll give this a try.

---

<div class="post-metadata">

**Author:** ![chad](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/chad/32/48202_2.png) [@chad](https://community.fly.io/u/chad)\
**Post date:** [April 1, 2022, 4:33pm UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/6 "2022-04-01T16:33:40Z")

</div>

[hacker voice] I’m in.

Website launched following the stack-specific README.md directions!

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [April 1, 2022, 10:59pm UTC](https://community.fly.io/t/another-cant-deploy-a-new-remix-app-post/4587/7 "2022-04-01T22:59:35Z")

</div>

Yeah we should link to the stack READMEs from our guide, that would make a lot of sense.
