@skyra/env-utilities is not assignable to parameter of type 'never'

I am not sure what to do here https://juan.evaded.tax/i/k6e74.png
Solution:
it's ArrayString you need, not EnvArray
Jump to solution
21 Replies
Juan Pablo
Juan Pablo2y ago
I fixed the default value to be an array but it's still broken
Juan Pablo
Juan Pablo2y ago
okay am I straight up using the library wrong? https://juan.evaded.tax/i/f6fmc.png
Juan Pablo
Juan Pablo2y ago
oh I see what I'm supposed to do https://juan.evaded.tax/i/xh4cx.png
Krish
Krish2y ago
Can we see your interface?
Juan Pablo
Juan Pablo2y ago
do they have to be in separate files? hopefully I'll get the answer I need when I wake up lol
Favna
Favna2y ago
If that file has nothing but that code then you have to add at the bottom export default undefined because otherwise typescript sees it as a module declaration instead of a module augmentation. (This applies to all module augmentations, not just this lib)
Krish
Krish2y ago
this ^
Juan Pablo
Juan Pablo2y ago
no it's definitely just augmentation
Juan Pablo
Juan Pablo2y ago
WHAT THE HELL DISCORD
Favna
Favna2y ago
good lord man there is good code comments and there is bad yours is horrid you really dont need that many comments anyway im not sure about your problem. I don't see it in other projects. Try making sure all your dependencies are up to date for starters
Krish
Krish2y ago
// this is a comment ↓
// this is a variable `a` which stores the number 1
let a: number = 1;
// this is a comment ↓
// this is a variable `a` which stores the number 1
let a: number = 1;
Favna
Favna2y ago
// this is a comment ↓
// this is a variable `a` which stores the number 1
let a: number = 1;
// by writing comments around the code we can hopefully still understand the code 6 months from now
// please copy and paste these 2 lines below every variable, function, and class
// this is a comment ↓
// this is a variable `a` which stores the number 1
let a: number = 1;
// by writing comments around the code we can hopefully still understand the code 6 months from now
// please copy and paste these 2 lines below every variable, function, and class
Juan Pablo
Juan Pablo2y ago
to be fair I wrote this some time ago I removed those comments yesterday because I also realized that I don't need those comments lol I updated my all of my dependencies and I'm still having that type circular reference error
Juan Pablo
Juan Pablo2y ago
something broke here my reproducible error
import { type EnvArray, envParseArray } from '@skyra/env-utilities';

const test = envParseArray('ARRAY_TEST');

declare module '@skyra/env-utilities' {
interface Env {
ARRAY_TEST: EnvArray;
}
}
import { type EnvArray, envParseArray } from '@skyra/env-utilities';

const test = envParseArray('ARRAY_TEST');

declare module '@skyra/env-utilities' {
interface Env {
ARRAY_TEST: EnvArray;
}
}
ARRAY_TEST='1 2 3 4 5 6 7 8 9 10'
ARRAY_TEST='1 2 3 4 5 6 7 8 9 10'
Solution
Favna
Favna2y ago
it's ArrayString you need, not EnvArray
Juan Pablo
Juan Pablo2y ago
OOOHHH I see now thank you!
Want results from more Discord servers?
Add your server