importing in next js using @
Unanswered
Braconid wasp posted this in #help-forum
Braconid waspOP
import is working when i use relative path but not when using @ (absolute path)
16 Replies
is your tsconfig setup properly?
Chub mackerel
tsconfig should contains this
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}@Chub mackerel tsconfig should contains this
` "compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}`
Braconid waspOP
its like this
@@ts-ignore is your tsconfig setup properly?
Braconid waspOP
i guess the above is correct and not working in some files but working other files
see
Braconid waspOP
@Braconid wasp its like this
Chub mackerel
did you use
src file?Braconid waspOP
i don't have src file or folder
Chub mackerel
try this structure in your tsconfig
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"plugins": [
{
"name": "next"
}
]
}@Chub mackerel try this structure in your tsconfig
`{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"plugins": [
{
"name": "next"
}
]
}
`
Braconid waspOP
yeah i changed but its still the same like if i open the file then its showing error if i close the file then it not
i changed it to "@/": ["./"]
but some errors got solved but some are not same error name
Chub mackerel
is this project open source?
@Chub mackerel is this project open source?
Braconid waspOP
not yet
Braconid waspOP
i am planning on using relative path for entire project