question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property 'required' does not exist on type 'IPresentVariable'. ts(2339)

See original GitHub issue

Describe the bug 🐛 As title.

To Reproduce 📝 Just copy the code from https://github.com/evanshortiss/env-var#variable

const SECRET = env.get('SECRET', 'bad-secret').required(NODE_ENV === 'production').asString()

Expected behaviour 🤷‍♂️🤷 Should not complain about Property 'required' does not exist on type 'IPresentVariable'. ts(2339)

Screenshots 📷 image

Environment (please complete the following information) 💻:

  • OS: macOS
  • Runtime: VS Code
  • Version: 1.41.1

Additional context

// Works fine without setting the default value
const SECRET = env.get('SECRET').required(process.env.NODE_ENV === 'production').asString()

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
evanshortisscommented, Feb 13, 2020

@kenberkeley fixed in 6.x

5reactions
evanshortisscommented, Feb 7, 2020

@kenberkeley I will fix this in 6.x coming soon. Leaving the issue open until that time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error TS2339: Property 'value' does not exist on type 'Object'
I have searched around for a far bit, but can't seem to find a solution to my problem. I have the following code;...
Read more >
property 'title' does not exist on type 'never'.ts(2339) - You.com
Well, the main point is that your accumulator does not have a type so the acc variable it is not supposed to have...
Read more >
Getting error TS2339: Property does not exist on type ... - GitHub
I have the following ES6 class class MyClass { constructor(){ this.myclassvar = 'abc'; } } When compiled/transpiled through TypeScript it ...
Read more >
Property does not exist on type String in TypeScript | bobbyhadz
The "Property does not exist on type String" error occurs when we try to access a property that does not exist on the...
Read more >
TS2339: Property does not exist on type : WEB-42908
TS2339 : Property 'index' does not exist on type 'Repository'. But, when I compile with TypeScript, it reports zero errors. Further, if I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found