Next.js Discord

Discord Forum

nextjs installation error

Answered
Arti Gaund posted this in #help-forum
Open in Discord
After installing nextjs it showing red line in code, cannot find main, div, classname...
Answered by riský
and do you have @types/react and @types/react-dom in package.json?
View full answer

17 Replies

try restarting the IDE as sometimes it doesn't register the new types of react
i am doing it from yesterday, it showing same issues, i have installed the project multiple time but problem is same, even restarted the ide multiple time. Is there any configuration to be done in vs code, which is causing the problem?
maybe you have some additinoal eslint rules that overrides it ?
first can you send your tsconfig.json file
@ekimcem first can you send your tsconfig.json file
I am reinstall it.
{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}
Dunker
change your moduleresolution to node, instead bundler
@Dunker change your moduleresolution to node, instead bundler
but error are still same
Dunker
f1 > restart typescript
@Dunker f1 > restart typescript
not resolved
Dunker
npm ls
and do you have @types/react and @types/react-dom in package.json?
Answer
@riský and do you have `@types/react` and `@types/react-dom` in package.json?
My red line issue is been resolved, i tried to disable the extension from vs code and reloaded the tailwindcss extension. but the output screen problem is still there.
Keep only the @tailwind statements and start from there
@joulev This is due to the default css, just remove all the unnecessary stuff in globals.css
oh yeah its working now. Thanks. 🙂