Next.js Discord

Discord Forum

Vercel build

Answered
DanielHigh posted this in #help-forum
Open in Discord
Hello, I'm trying to build my app but I keep getting an error on Vercel.

When I build that on localhost I have no problem with that.

I've tried to make the path like: "../../../components/Loader or just "@/app/components/Loader" but either one is not working.

This is my tsconfig.json:
{
  "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"
      }
    ],
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"],
      "@/components/*": ["app/components/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}


Loader:
function Loader() {
    return (
    <div className="flex justify-center items-center mt-20 mb-20">
        <div className="animate-spin rounded-full h-16 w-16 border-t-4 border-b-4 border-sky-blue"></div>
      </div>
    );
  };
  
  export default Loader;


/admin/approved/[id]/page.tsx imports:
'use client'

import { useEffect, useState } from "react"
import { useRouter } from "next/navigation"
import Loader from "@/components/Loader"
import OnlyAdmin from '@/components/OnlyAdmin';
import useAuthenticatedFetch from '@/app/lib/authenticatedFetch';


Thank you very much!
Answered by DanielHigh
Oh, I've just found the issue.

I've created a loader.tsx first and renamed it to Loader.tsx, but it did not rename on github, so it was uploaded with lower case to Vercel.
View full answer

1 Reply

Oh, I've just found the issue.

I've created a loader.tsx first and renamed it to Loader.tsx, but it did not rename on github, so it was uploaded with lower case to Vercel.
Answer