invertase / globe

🌎 The global deployment platform for Dart & Flutter applications.

Home Page:https://globe.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying dart frog project with postgres database

consciousmayank opened this issue · comments

Is there an existing feature request for this?

  • I have searched the existing issues.

Description

While deploying dart frog application with no database configured works perfectly. A POC works great but when I try deploying a dart project with a database (postgres) configured. I am getting a 500 error.
Screenshot_20240604_120242_Chrome

Reasoning

I feel deploying dart frog backend app is a breeze in globe. If postgres or anyother db is supported then, many devs can start using dart as backend. Atleast I would.

Additional context and comments

No response

Hello! Where is your database located?

Oh I guess I am understanding the issue now. While development it was in my local machine. Correct me if i am wrong.

I need to host the databse in some place like render, if thats right can you guide me somewhere i can follow some documents so that I can go forward?

@Ehesp just now i tried, creating a postgresql database instance in Render. Connected to it via development. Was able to create and read data. Then when I tried to deploy the same code, in globe again in preview. Its giving same error. My development id is 102b9062-1b12-4fca-9229-a06e4c0a01d2, and my buildId is fbe72fda-00c2-4931-afff-dbd469a53bd4. The url which was given to me is https://dart-frog-notes-api-vkm1i92-consciousmayank.globeapp.dev/. Same happens when deployed in prod. https://dart-frog-notes-api-vobems2-consciousmayank.globeapp.dev/

Not even showing the root route, which is obviously "Welcome to dart".

I thought hosting postgresql in render will solve this problem but it persists. Hence opening the issue again.

Hey, I've raised this with the team, they're going to investigate :)

@consciousmayank your deployment crashes with

Unhandled exception:
Invalid argument(s): A directory corresponding to fileSystemPath "public" could not be found
#0      createStaticHandler (package:shelf_static/src/static_handler.dart:50)
#1      createStaticFileHandler (package:dart_frog/src/create_static_file_handler.dart:7)

This is happening, because we only deploy compiled executable, although we have some plans to allow deploying some files alongside the executable as well.

An issue on our end is: for some reason, this error isn't written into deployment logs, so there is no chance for you to figure out what's wrong on your own. Created an internal tracking issue.

Ok. Thanks for the resolution. I hope in upcoming releases, soon this error gets resolved. Deploying dart server globally, would be helpful.