getting typescript error ts(2307} and ts(7026} in new nextjs setup with yarn create next-app@latest
Answered
▄︻デZ̷o̷r̷o̷ ̷O̷P̷╅ posted this in #help-forum
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
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
5 Replies
You need to install node modules
Answer
It should be directly created when i do yarn install roght?
@baked
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
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