theodorusclarence / ts-nextjs-tailwind-starter

🔋 Next.js + Tailwind CSS + TypeScript starter and boilerplate packed with useful development features
https://tsnext-tw.thcl.dev/
2.91k stars 511 forks source link

Getting errors in tsconfig.json file #93

Closed Kingkon963 closed 2 years ago

Kingkon963 commented 2 years ago

I'm getting this error whenever I try to add Tailwindcss to my Nextjs project initiated with "create-next-app --typescript". Therefore I wanted to try your template but now having the exact same issue.

image

I have tried installing types for 'accepts' using "yarn add @types/accepts" but then it shows the same error for "body-parser" and keeps going on and on and telling me to add types for different packages which are unknown to me.

Do you know why is this happening?

Kingkon963 commented 2 years ago

This issue got resolved after installing all of the following types. But I still couldn't figure out why that happened

@types/accepts
@types/body-parser
@types/bson
@types/content-disposition
@types/cookies
@types/formidable
@types/fs-capacitor
@types/glob
@types/hoist-non-react-statics
@types/http-assert
@types/http-errors
@types/invariant
@types/json-schema
@types/koa
@types/koa-bodyparser
@types/koa__cors
@types/lodash
@types/long
@types/mongodb
@types/node-fetch
@types/react-redux
@types/ws
theodorusclarence commented 2 years ago

I never get this error before, can you try with this exact command? without the --typescript flag

npx create-next-app -e https://github.com/theodorusclarence/ts-nextjs-tailwind-starter project-name

theodorusclarence commented 2 years ago

is there any update? @Kingkon963

Kingkon963 commented 2 years ago

Hi @theodorusclarence, Sorry for being late and thank you for your reply.

I never get this error before, can you try with this exact command? without the --typescript flag

npx create-next-app -e https://github.com/theodorusclarence/ts-nextjs-tailwind-starter project-name

I have just tried this and the error is still there. I neither faced this error before the release of Tailwindcss v3

Kingkon963 commented 2 years ago

I got rid of this annoying error after doing the following,

  1. Installed @types/node yarn add -D @types/node
  2. Added "types": ["node"] in the compilerOptions of the tsconfig.json file

Screenshot 2022-09-09 215114