react-flag-icon-css icon indicating copy to clipboard operation
react-flag-icon-css copied to clipboard

Error when using with next

Open lamualfa opened this issue 4 years ago • 0 comments

Report a bug:

Basic information:

  • react-flag-icon-css version: ^1.0.25
  • Module bundler: I use next version: ^9.3.2
  • The output of node -v: v10.16.3

Description

I use next with Global Stylesheets

Error when compiled:

../node_modules/react-flag-icon-css/module/styles/main.css
Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm
Location: ../node_modules/react-flag-icon-css/module/styles.js

How I am creating FlagIcon

import styles from './FlagIcon.module.scss';

import React from 'react';
import { CustomFlagIconFactory } from 'react-flag-icon-css';

const FlagIcon = CustomFlagIconFactory(React, {
  // I have also tried with the value `true`, but still can't
  useCssModules: false,
  themeStyles: styles
});

export default FlagIcon;

lamualfa avatar Mar 29 '20 15:03 lamualfa