Next.js Discord

Discord Forum

Component file names must be all lowercase or errors

Unanswered
Amur catfish posted this in #help-forum
Open in Discord
Amur catfishOP
Hello, when trying to create a .tsx component in src/components directory that has any uppercase I get the following error:
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.
My .tsconfig was generated by create-next-app. Here it is below:
{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "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"]
}

2 Replies

Amur catfishOP
Does anyone know?
how did you declare the react component?