matteocng / react-flag-icon-css

Simple React SVG country flags Component, supports standard Css and Css Modules.
MIT License
86 stars 13 forks source link

Error when using with next #141

Open lamualfa opened 4 years ago

lamualfa commented 4 years ago

Report a bug:

Basic information:

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;