Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default import not working #67

Open
im-calvin opened this issue Jan 11, 2024 · 4 comments
Open

Default import not working #67

im-calvin opened this issue Jan 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@im-calvin
Copy link

Just had a really weird bug I want to document. I was using the import as expected:

import Hamburger from "hamburger-react";

and for some reason I was running into this issue, Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. which means that my import wasn't right.

Super weird since the default import is already specified and it works in development, but it fails when I run npm run build

If I change the import to import {Squash as Hamburger} from 'hamburger-react';, it works again.

@cyntler cyntler added the bug Something isn't working label Jan 28, 2024
@cyntler
Copy link
Owner

cyntler commented Jan 28, 2024

@im-calvin Can you provide more info about your dev environment? Do you use Next.js or any another framework/library? You Node.js version etc.

@im-calvin
Copy link
Author

I'm using Astro and React with npm and node version 18.14.1

@didnotwant
Copy link

@im-calvin I also had a problem with the default-exported Hamburger, and importing the concrete kind of it (I used Squash) resolved it – now I can't reproduce it after a quick attempt to get back to the default import, but my problem was related to React, and I had a wrapper component for the Hamburger using the Astro-React integration

@im-calvin
Copy link
Author

@didnotwant

I think then the problem might be to do with Astro/react and the way that it handles dependency bundles? I'm not 100% certain but it seems likely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants