Skip to content
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: vaultEnv.on is not a function #13

Open
iiro opened this issue Aug 6, 2021 · 1 comment
Open

TypeError: vaultEnv.on is not a function #13

iiro opened this issue Aug 6, 2021 · 1 comment

Comments

@iiro
Copy link

iiro commented Aug 6, 2021

Hi!

I noticed an issue when trying to use the lease-"monitoring":

➜  example node app.js
vault-env: fetching 3 secrets from http://localhost:8210/
vault-env: loading TEST_DB_USERNAME, TEST_DB_PASSWORD from postgres/creds/myrole ✓
Example app listening at http://localhost:8080
My test secret is: secret_value2
/Users/username/checkouts/vault/apps/node/example/app.js:22
  vaultEnv.on("DATABASE_URL", function (newDB, oldDB) {
           ^

TypeError: vaultEnv.on is not a function
    at Server.<anonymous> (/Users/username/checkouts/vault/apps/node/example/app.js:22:12)
    at Object.onceWrapper (node:events:513:28)
    at Server.emit (node:events:394:28)
    at emitListeningNT (node:net:1349:10)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

Is there something "obvious" to fix - either in the example in the README or in code...?

Running NodeJS v16.6.1 here.

@iiro
Copy link
Author

iiro commented Aug 6, 2021

Just writing this to myself: this is needed only for static secrets, I think... As with leased secrets, there's no need to "watch"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant