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

JS error #13

Open
UndercoverNL opened this issue Jan 7, 2023 · 1 comment
Open

JS error #13

UndercoverNL opened this issue Jan 7, 2023 · 1 comment

Comments

@UndercoverNL
Copy link

UndercoverNL commented Jan 7, 2023

Well as I assume this will never be answered or fixed as this repo looks kind of dying, il just inform you guys that you don't need to try the package anymore when using typescript, as it seems to error inside the package

image

which is coming from import { IconPickerItem, IconList } from 'react-fa-icon-picker';

If anyone does have a fix for this let me know, would like to use the package.

@LynchyC
Copy link

LynchyC commented Jun 28, 2023

@UndercoverNL For yourself or anyone else that is still experiencing this issue:

This issue arises from the styled-components dependency that is used within this library. V5 of styled-components has apparently had a lot of issues with its default export (see here).

I managed to fix this by adding the following to my vite.config.ts:

import { defineConfig } from 'vite';

export default defineConfig(() => {
  return {
    ...
    resolve: {
      alias: {
        'styled-components': 'styled-components/dist/styled-components.js',
      },
    },
  };
});

If you are using webpack, the same can be done using their resolve.alias feature.

I hope this helps

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

2 participants