Next.js Discord

Discord Forum

getting typescript error ts(2307} and ts(7026} in new nextjs setup with yarn create next-app@latest

Avatar
im new to typescript and nextjs and trying to use shadcn ui library https://ui.shadcn.com/docs/installation/next

and using their given method to create the nextjs app but it showing multiple errors

Cannot find module 'foo' or its corresponding type declarations in every module import

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. in every jsx

Cannot find namespace 'React'.

and i cant figure out what is wrong i tryed some method but not single one is working for me

im using yarn 3.5 with corepack and node v18.13.0
Image
Answered by baked
You need to install node modules
View full answer

5 Replies

Avatar
You need to install node modules
Answer
Avatar
It should be directly created when i do yarn install roght?
@baked
Avatar
It should. Not 100% sure but it looks like it’s using yarn pnp which I don’t really know of how it works and how vscode works with it
Avatar
actually when i hit yarn it install all the packages from npm directory and creates node_modules folder after that it form symlink in nodemodule to .yarn folder and this step are directly done so this should be treated as bug right and their is no solution for this issue on intermate