Property 'required' does not exist on type 'IPresentVariable'. ts(2339)
See original GitHub issueDescribe 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 📷
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:
- Created 4 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kenberkeley fixed in 6.x
@kenberkeley I will fix this in 6.x coming soon. Leaving the issue open until that time.