Failed deploy during build with Module not found error

I’ve successfully deployed my app a couple of times but after adding a custom domain I started to get “Module not found” errors.(not sure if it’s related)

I started to get “Module not found” errors when I deployed during the build phase. Locally build work correctly. Also, I made no changes in the files that I’m getting errors.

I’ve tried to redeploy old successful deployments but they all started getting the same error. I don’t understand why it began to happen.
Can someone help me?

I’m using React 19.0 and Next 15.1.3
The code where I do import

"use client";

import { Azeret_Mono as Geist_Mono } from "next/font/google";
import { Sidebar } from "@/components/Sidebar";
import "../globals.css";
import Session from "supertokens-web-js/recipe/session";

The file name of sidebar:

tsconfig:

{
  "compilerOptions": {
    "target": "ES2017",
    "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": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

Project structure:

My package.json file

{
  "name": "gamedev_saas_client_new",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev --turbopack",
    "build": "set NODE_ENV=production && next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@hookform/resolvers": "^3.10.0",
    "@radix-ui/react-avatar": "^1.1.2",
    "@radix-ui/react-checkbox": "^1.1.3",
    "@radix-ui/react-dialog": "^1.1.4",
    "@radix-ui/react-label": "^2.1.1",
    "@radix-ui/react-popover": "^1.1.4",
    "@radix-ui/react-scroll-area": "^1.2.2",
    "@radix-ui/react-select": "^2.1.4",
    "@radix-ui/react-slider": "^1.2.2",
    "@radix-ui/react-slot": "^1.1.1",
    "@radix-ui/react-tooltip": "^1.1.6",
    "@tanstack/react-query": "^5.62.11",
    "@tanstack/react-table": "^8.20.6",
    "axios": "^1.7.9",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "cmdk": "^1.0.0",
    "countries-list": "^3.1.1",
    "lucide-react": "^0.469.0",
    "next": "15.1.3",
    "posthog-js": "^1.205.0",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "react-hook-form": "^7.54.2",
    "react-icons": "^5.4.0",
    "supertokens-web-js": "^0.14.0",
    "tailwind-merge": "^2.6.0",
    "tailwindcss-animate": "^1.0.7",
    "zod": "^3.24.1",
    "zustand": "^5.0.3"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.1.3",
    "postcss": "^8",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }
}

It looks like the components are inside a ui directory. Does it make a difference if you change the the path to @/components/ui/Sidebar?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.