Sapphire - Imagine a framework
Sapphire - Imagine a framework

sapphire-support

Root Question Message

Juan Pablo
Juan Pablo1/28/2023
@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
Juan Pablo
Juan Pablo1/28/2023
I fixed the default value to be an array but it's still broken
Juan Pablo
Juan Pablo1/28/2023
okay am I straight up using the library wrong?
https://juan.evaded.tax/i/f6fmc.png
Juan Pablo
Juan Pablo1/28/2023
oh I see what I'm supposed to do
https://juan.evaded.tax/i/xh4cx.png
Juan Pablo
Juan Pablo1/28/2023
Krish
Krish1/28/2023
Can we see your interface?
Juan Pablo
Juan Pablo1/28/2023
do they have to be in separate files?
Juan Pablo
Juan Pablo1/28/2023
hopefully I'll get the answer I need when I wake up lol
Favna
Favna1/28/2023
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
Krish1/28/2023
this ^
Juan Pablo
Juan Pablo1/28/2023
no it's definitely just augmentation
Juan Pablo
Juan Pablo1/28/2023
WHAT THE HELL DISCORD
Favna
Favna1/29/2023
good lord man
Favna
Favna1/29/2023
there is good code comments and there is bad
Favna
Favna1/29/2023
yours is horrid
Favna
Favna1/29/2023
you really dont need that many comments
Favna
Favna1/29/2023
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
Krish1/29/2023
// this is a comment ↓
// this is a variable `a` which stores the number 1
let a: number = 1;
Favna
Favna1/29/2023
// 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 Pablo1/29/2023
to be fair I wrote this some time ago
Juan Pablo
Juan Pablo1/29/2023
I removed those comments yesterday because I also realized that I don't need those comments lol
Juan Pablo
Juan Pablo1/29/2023
I updated my all of my dependencies and I'm still having that type circular reference error
Juan Pablo
Juan Pablo1/29/2023
something broke here
Juan Pablo
Juan Pablo1/29/2023
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;
    }
}
Juan Pablo
Juan Pablo1/29/2023
ARRAY_TEST='1 2 3 4 5 6 7 8 9 10'
Favna
Favna1/29/2023
it's ArrayString you need, not EnvArray
Juan Pablo
Juan Pablo1/29/2023
OOOHHH
Juan Pablo
Juan Pablo1/29/2023
I see now
Juan Pablo
Juan Pablo1/29/2023
thank you!
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy