Payload Version "payload": "^2.0.0"
Node Version node:18.8-alpine
Next.js Version "next": "13.5.2"
Bug
When I run yarn build I got this error:
[12:41:39] ERROR (payload): Error: cannot connect to Postgres. Details: getaddrinfo ENOTFOUND postgres
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This is my database uri:
DATABASE_URI="postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}"
-
This question is similar to: What is the format for the PostgreSQL connection string / URL?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.pkExec– pkExec2024年07月23日 12:17:44 +00:00Commented Jul 23, 2024 at 12:17
-
It's not a connection string problem, it's a db connection on build problem. Payload problemEmanuele– Emanuele2024年07月23日 15:47:36 +00:00Commented Jul 23, 2024 at 15:47
1 Answer 1
Add the client ID to your build command:
flutter build web --dart-define=GOOGLE_CLIENT_ID=YOUR_CLIENT_ID.apps.googleusercontent.com
flutter run -d chrome --dart-define=GOOGLE_CLIENT_ID=YOUR_CLIENT_ID.apps.googleusercontent.com
In the Dart code:
GoogleSignIn googleSignIn = GoogleSignIn(
clientId: const String.fromEnvironment('GOOGLE_CLIENT_ID'),
);
Ensure the meta tag is in web/index.html:
<meta name="google-signin-client_id" content="YOUR_CLIENT_ID.apps.googleusercontent.com">
This should properly pass and read the GOOGLE_CLIENT_ID.
answered Jul 23, 2024 at 11:29
Anastasios3
1191 silver badge14 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
Information Tech
This should not findin postgres server. check hostname and credentials. maybe docker issue?
Emanuele
I'm not usign flutter with dart. I'm using payload with typescript
Explore related questions
See similar questions with these tags.
lang-sql