Skip to content

PAYLOAD_PUBLIC not propagating to collections? #1283

Answered by jmikrut
adam-mrozik asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @adam-mrozik — I have some thoughts for you.

Are you using dotenv? Make sure that your dotenv correctly points to your .env file in both dev and production. Often times we've seen it where, for whatever reason, the folder structure differs from /src to /dist if using TS, and then dotenv can no longer find your .env file.

dotenv unfortunately won't error if it can't find the .env....It just simply won't bind any variables.

You can circumvent this problem by specifying a path to dotenv that you are SURE points to your .env file in production cases.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@adam-mrozik
Comment options

@jmikrut
Comment options

@adam-mrozik
Comment options

@dotellie
Comment options

@vibhor-web-headout
Comment options

Answer selected by adam-mrozik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants