Next.js Discord

Discord Forum

contentlayer not importing

Unanswered
Beans posted this in #help-forum
Open in Discord
contentlayer not importing. accidentally deleted my contentlayer folder, but put it back and now it won't import properly. see image.

31 Replies

note that the project deploys to vercel fine. however, i now cannot view definitions for my post. for example, post.summary "doesn't have a definition" because it cant find the contentlayer folder (i think).
B
for example, post.slug here
i think the issue is that the import cannot find the contentlayer/generated file. but i have no idea why.
Lapland Longspur
Try to uninstall it first then install again
@Lapland Longspur Try to uninstall it first then install again
Uninstall content layer?
@Beans Uninstall content layer?
Lapland Longspur
Is that an npm package?
@Lapland Longspur Is that an npm package?
Well yeah, it’s so I can use mdx files for my project descriptions
But it’s also a file
Lapland Longspur
I've ran the same issue before and what I did was npm uninstall <pkg_name> and then npm i <pkg_name> and it solved my issue
alright lemme give it a shot real quick
well
now im real lost LOL
Lapland Longspur
Can i see your package.json file
nvm i was running it in mingw
but still, error
@Beans Click to see attachment
Lapland Longspur
Strange. It's not removing packages when running npm uninstall
@Lapland Longspur Strange. It's not removing packages when running npm uninstall
follow up question. I'm trying to add these techstack and github things to my mdx
but it gives this error:
bhut it clearly does exizst
because im defining it right there
and this is the issue when i try and use pnpm to install/uninstall