Palmabit-IT / react-cookie-law

React Cookie Law is a cookie-info banner compliance with the GDPR and the EU cookie law. It allows the user to give consent in a granular way.
113 stars 55 forks source link

Failed to compile, module not found #1

Open vichaunter opened 5 years ago

vichaunter commented 5 years ago

Just followed your instructions to install it with yarn, but error break script execution.

To be sure, i've just create-react-app, yarn start, and included:

import CookieBanner from "react-cookie-law";

In that moment recompiled app breaks: Failed to compile ./src/App.js Module not found: Can't resolve 'react-cookie-law' in 'C:\Users\vicha\workspace\test\reactapp\src'

To reproduce you just need to create new react app, install the module with yarn, and run yarn start importing the package.

asarzina commented 5 years ago

I'm sorry, the readme was not updated. Now it is ok.

You should import the library in this way:

import { CookieBanner } from '@palmabit/react-cookie-law';