Skip to content

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. #13621

@vipulbhj

Description

@vipulbhj

I'm using React Router as a...

framework

Reproduction

Image
import { type RouteConfig, index, route } from "@react-router/dev/routes";

export default [
  index("routes/home.tsx"),
  route("onboarding", "routes/onboarding.tsx"),
  route("dashboard", "routes/dashboard.tsx"),
] satisfies RouteConfig;
import type { Route } from "./+types/dashboard";

import { SidebarProvider } from "~/components/ui/sidebar";
import { DashboardSidebar } from "~/components/dashboard/sidebar";

export function meta({}: Route.MetaArgs) {
  return [
    { title: "Dashboard | Profi" },
    { name: "description", content: "Some description" },
  ];
}

export default function Dashboard() {
  return (
    <SidebarProvider>
      <main className="w-full">
        <div className="w-full h-full bg-blue-900" />
      </main>
      <DashboardSidebar />
    </SidebarProvider>
  );
}

When I save file, UI shows, but when I browser refresh, it shows the above error

System Info

Error screen is shown

Used Package Manager

npm

Expected Behavior

Refresh should also show the UI correctly

Actual Behavior

Error screen is shown

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions