Path Problem
Answered
Dutch posted this in #help-forum
DutchOP
i get this error when i use @
but i use .. it works
i tried fixing the json file
still its misbehaving
why?
but i use .. it works
i tried fixing the json file
still its misbehaving
why?
Answered by Bighead carp
in your tsconfig.json, inside
compilerOptions, add this: "paths": {
"@/*": ["./*"]
}44 Replies
@Dutch i get this error when i use @
but i use .. it works
i tried fixing the json file
still its misbehaving
why?
Bighead carp
what does your tsconfig.json look like
And also send a screenshot of your folder structure
DutchOP
Bighead carp
You need to set up the
@ alias. It's not something that exists without configurationBighead carp
in your tsconfig.json, inside
compilerOptions, add this: "paths": {
"@/*": ["./*"]
}Answer
DutchOP
i did it while installing the app
and it game me error now
while it was working fine since 3 days
Bighead carp
Well you need that alias set up in tsconfig either way, it wont work otherwise.
DutchOP
i alreadyy have this in my jsconfig.json file
@Bighead carp Well you need that alias set up in tsconfig either way, it wont work otherwise.
DutchOP
but i already had it and it still throws me this error while using @
@Dutch Click to see attachment
Bighead carp
Where is this code? it's not in your initial screenshot
DutchOP
that one was tsconfig
this is jsconfig
Bighead carp
You either use tsconfig or jsconfig. having both is bad
My opinion would be to move that into your tsconfig, and then delete jsconfig
DutchOP
lemme try and see wwhat happens
Bighead carp
Do you plan on having any typescript in your code
DutchOP
not now
Bighead carp
Ok then instead of deleting jsconfig, move everything into jsconfig
Then delete tsconfig
DutchOP
i think so adding it to tsconfig was needed idk why it was working with @ before
since last 3 ddays
bruh
Bighead carp
what file are you importing it from
DutchOP
jsx
Bighead carp
does it work now?
DutchOP
yeh it does but i dont understand wwhy it wwas working before
i had to use relative path
and now that i updated tsconfig its working with @
Bighead carp
Tbh i suggest using typescript for any of your programming
But thats just my opinion
make sure to mark the solution by right clicking the message that fixed it and going to 'Apps > Mark Solution'
DutchOP
u saying maybe cus it was jsx it wwas throwwing the issue?
Bighead carp
nah
typescript is just better
DutchOP
shit works works fk it
Bighead carp
amen brother
DutchOP
peace
Bighead carp
make sure to mark the solution
DutchOP
how do i do that
Bighead carp
by right clicking the message that fixed it and going to 'Apps > Mark Solution'
DutchOP
oh ok