After deploying Remix’s Jokes App as described in the tutorial, the following error occurs when accessing /jokes in the production environment.
The error does not occur in the local environment.
https://remix.run/docs/en/v1/tutorials/jokes#deployment
2022-02-07T06:14:33.750 app[66f993a3] sin [info] There was an error running the data loader for route routes/jokes
2022-02-07T06:14:33.751 app[66f993a3] sin [info] Error: The table `main.Joke` does not exist in the current database.
2022-02-07T06:14:33.751 app[66f993a3] sin [info] at cb (/app/node_modules/@prisma/client/runtime/index.js:38691:17)
2022-02-07T06:14:33.751 app[66f993a3] sin [info] at async loader3 (/app/build/index.js:752:25)
2022-02-07T06:14:33.751 app[66f993a3] sin [info] at async Object.callRouteLoader (/app/node_modules/@remix-run/server-runtime/data.js:73:14)
2022-02-07T06:14:33.752 app[66f993a3] sin [info] GET /jokes 500 - - 5.340 ms
The fly.toml is as follows.
# fly.toml file generated for remix-jokes-84532361 on 2022-02-07T02:57:13Z
app = "remix-jokes-84532361"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[env]
DATABASE_URL = "file:./dev.db"
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]]
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"