Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Inertia React #375

Open
DeviJv opened this issue Feb 16, 2023 · 1 comment
Open

Inertia React #375

DeviJv opened this issue Feb 16, 2023 · 1 comment

Comments

@DeviJv
Copy link

DeviJv commented Feb 16, 2023

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

@vitkarpov
Copy link

vitkarpov commented Jun 13, 2023

UPD sorry, it's "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object." not undefined

Happened to me whilst migrating from vite@3.x to vite@4.x too, most likely because of esbuild.

I found a hack to work around this:

import Tippy from '@tippyjs/react';

const TippyComponent =
    (Tippy as unknown as { default: typeof Tippy }).default ??
    Tippy;

then use <TippyComponent> instead of <Tippy> in the app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants