Issue with alias next.js 15 default config
Unanswered
Britannia Petite posted this in #help-forum
Britannia PetiteOP
Hi, got some issue with default alias @ in next.js 15, i'm using TS.
ts compiler options:
and got :
Module not found: Can't resolve '@/components/ui'
in layout.tsx
for
file structure:
Any help would be appreciated 🙂 thank you !
ts compiler options:
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}and got :
Module not found: Can't resolve '@/components/ui'
in layout.tsx
for
import { Menu } from "@/components/ui";file structure:
src/
layou.tsx
components/
/ui
Menu.tsxAny help would be appreciated 🙂 thank you !
3 Replies
@Britannia Petite Hi, got some issue with default alias @ in next.js 15, i'm using TS.
ts compiler options:
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
and got :
Module not found: Can't resolve '@/components/ui'
in layout.tsx
for import { Menu } from "@/components/ui";
file structure:
src/
layou.tsx
components/
/ui
Menu.tsx
Any help would be appreciated 🙂 thank you !
You will need to import Menu from
@/components/ui/MenuIf you want to just be able to import from
e.g.
@/components/ui you will need an index.ts file inside that folder that exports all the componentse.g.
export * from "@/components/ui/Menu";Britannia PetiteOP
Yes of course, but I don’t have any auto completion for all imports