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

Build error #69

Closed
nghiant96 opened this issue Mar 24, 2022 · 8 comments
Closed

Build error #69

nghiant96 opened this issue Mar 24, 2022 · 8 comments

Comments

@nghiant96
Copy link

nghiant96 commented Mar 24, 2022

Hello. I am using icon set for my project. It worked fine until. But when I build and run it doesn't work. I am using vite to build the project.
The full text of the error you just encountered is:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Version of me:
"@mdi/js": "^6.5.95",
"@mdi/react": "^1.5.0",
"react": "^17.0.2",

@Templarian
Copy link
Owner

Templarian commented Apr 16, 2022

@nghiant96 I just bumped the demo project to v18.0.0 with the existing 1.6.0 package and it seems fine.

Can you please retry with 1.6.0? I'm trying to not bump versions in this until I know there are breaking changes.

Updated to v18.0.0 / 1.6.0 https://templarian.github.io/@mdi/react/

@versoworks
Copy link

@Templarian https://templarian.github.io/@mdi/react/ isn't rendering in Edge & Safari here; console shows 404 returned for a couple of resources.

@nghiant96
Copy link
Author

nghiant96 commented Apr 25, 2022

@Templarian
i fix it
import Icon from '@mdi/react';
to
import { Icon } from '@mdi/react';

@Templarian
Copy link
Owner

@versoworks Fixed, forgot to remove the absolute paths. 🤦

@dzcpy
Copy link

dzcpy commented Sep 12, 2022

Shall we change the example code in the README?

@craigrileyuk
Copy link

I just lost hours to this issue thinking it was my build process that was causing the error.

Please add it to the README!

@HugoGresse
Copy link

As stated in the reference above, this is a bug in Vite : vitejs/vite#2139
It impact many packages.

@Mossop
Copy link

Mossop commented Feb 24, 2024

@Templarian i fix it import Icon from '@mdi/react'; to import { Icon } from '@mdi/react';

This doesn't seem to work anymore? I get the following error:

[vite] Named export 'Icon' not found. The requested module '@mdi/react' is a CommonJS module, which may not support all module.exports as named exports

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

No branches or pull requests

7 participants