2

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}"

2
  • 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. Commented Jul 23, 2024 at 12:17
  • It's not a connection string problem, it's a db connection on build problem. Payload problem Commented Jul 23, 2024 at 15:47

1 Answer 1

-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.

Sign up to request clarification or add additional context in comments.

2 Comments

This should not findin postgres server. check hostname and credentials. maybe docker issue?
I'm not usign flutter with dart. I'm using payload with typescript

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.