-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'PORT' of undefined at Object... #2
Comments
Hi Dave, thanks for both comments! I remember the issue vaguely, but this is what I know: I think the plugin needs to be loaded using an As all of the above calls happen async, the |
@davidshq I have discovered the same issue that you did. Quite by mistake. I played with the fastify-env config targeting in the app.listen object for 2 hours. I finally gave up and went back to what I knew that would work -- old fashion dotenv. Outside of that this easy sample of fastify separate routes and controllers worked perfectly. |
Well, I agree that using dotenv here simplifies things and is more of an industry best practice than using fastivy-env. Sorry for adding that confusion to the article! |
No problem. I know how fast things change. I work as a programmer in an
Instructional Design and Development company. Adult, task based training
for US Government folks.
The Chief (US Navy Senior Chief Petty Officer (ret. Crypto/linguist)
…On Tue, Jan 19, 2021, 07:07 Michiel Mulders ***@***.***> wrote:
Well, I agree that using dotenv here simplifies things and is more of an
industry best practice than using fastivy-env. Sorry for adding that
confusion to the article!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACFHJXK2HUYCZU5TCTKHNTS2V7ZLANCNFSM4U4PMFJA>
.
|
When implementing the fastify-env plugin as outlined in your SitePoint article I'm getting an error:
My index.js file looks like this:
Any suggestions? I noted that in the index.js here you have the port hard-coded rather than using the fastify-env plugin.
Thanks!
The text was updated successfully, but these errors were encountered: